Pause Data Coming To A Consumer

I am attempting to actually pause the data coming into a Consumer object.

I have tried using both
pause()
and
track.enabled = false

In both cases, when I look at chrome://webrtc-internals/, it seems that I am still receiving the data (a bandwidth change does not occur). By contrast, when you call
track.enabled = false
on a the producer side, there is a significant drop off in bandwidth in the Consumers since they’re not receiving video or audio.

Is there a way on the Consumer side to have this same bandwidth savings, while still keeping a lightweight connection open to the Producer, so that it’s easy to restart streaming?

Yes, read the Consumer API at mediasoup server side.

I was hoping I could do something solely on the Client/Consumer side. Are you saying that I need to message the server, and then it needs to make the change?

Yes, you need to pause server-side Consumer (NOTE: Consumer is present both on the server and client).

1 Like

How can you stop receiving something from the other party without telling it to stop sending it?

I suppose in any case you would have to tell the server. I was just hoping this functionality would already be encapsulated in the API somehow, rather than having to implement server and client side handlers of it. Seems like it would be a relatively useful/frequent feature to pause incoming feeds. I’m guessing maybe you are just trying to keep the two sides (client/server) as modular as possible? Anyway, thanks for the heads up!

How could we “encapsulate it in the API somehow” if mediasoup does not include any signalling mechanism to communicate client and server?

Fair enough! Sorry, I’m a new user and I was conflating some of the technologies that I’m seeing in some examples. Appreciate your patience!

Yup, I know. Don’t worry. Please, at this stage, focus on mediasoup and mediasoup-client documentation and API. Check examples or demo projects later (my recommendation).

1 Like