Producer.pause() still uploading streams

Hi there,

When tuning off a camera/mic demo if I call producer.pause followed by the WS request to pause it server side I can still see network being used by the RTCOutboundRTPVideoStream.

The demo is (closing)[https://github.com/versatica/mediasoup-demo/blob/a8f415cb0e792d39eb044b9d11df498f27535a19/app/lib/RoomClient.js#L1047] the producer which creates RTCOutboundRTPVideoStreams after turning off and on.

I’m using Chrome 75.

Question 1:
By reading the documentation I would assume producer.pause() would stop using the network. Am I missing something here.

Question 2:
When calling close() and recreating the producer, is it normal to several RTCOutboundRTPVideoStreams be shown in webrtc-internals?

Tks.

producer.pause() just sets the “paused” flag and calls this._track.enabled = false, which means that it will send much less bitrate and it will just send silence packets (if audio) or black frames (if video).

mediasoup-client does not mangle the SDPs to completely sending silence or black frames when pausing the Producer. It would be done but it’s an absolute pain we prefer not to deal with.

Yes, because it also shows the closed ones (which no longer have activity).

1 Like

Does it include consumer.pause() too? Unfortunately on Safari the video gets black after consumer.pause() even if the media player is paused before.

Yes, consumer.pause() in mediasoup-client also sets this._track.enabled = false.

If this is a problem for you you can just avoid calling consumer.pause()in the client, but IMHO yours is a problem at UI level. IMHO disabling the remote track when “pausing” it is a good practice since it avoids such a track from being rendered/played. Anyway it’s a bit unnecessary since no RTP will be received if you also call pause() in the server side Consumer (or its associated Producer).

Not calling consumer.pause() in the client fixed the problem :ok_hand:.
I think it’s a bug with Safari since I’m using the native media player.