Audio, Video Track Disable With Mediasoup

Hi, My Problem Is Regarding Implementation Of Audio/Video On And Off Feature In Mediasoup App. The Problem I Am Facing Is That According To Traditional WebRTC Track Disabling, Camera Indicator Remains On Even When Track Is Disabled. I Am Implementing This Feature On My Own Without Using Producer.pause() By Mediasoup Which Essentially Does The Same I Suppose. I Read That Stopping The Track Completely Disables The Indicator But For This I Will Have To Close The Producer And Create Another Producer When A User Enables A Track And Again Notify Other Peers To Consume It Which Will Not Be Good I Think. I Saw Mediasoup Demo Implements The Same Thing And Camera Indicator Closes.

In Short, My Question Is What Would Be The Best Way To Implement Enabling And Disabling Of Tracks In Mediasoup?

For video, stopping the track when user turns off video is the way to go and when user will turn on the video again then you will have to make the transports etc again which can cause around 3 seconds of delay but for video this is acceptable.

For audio, you can pause the track as you mentioned, and by doing that you will not have to recreate the transport etc when user turns back on the audio and hence no delay. Indicator will be on as you mentioned but for user experience that will be the tradeoff, google meet already does this, you can check.
Apart from that you can even stop the audio tracks just like video and when user turns audio on again then you will have to create transports again which might cause 2-3 seconds delay which might not be acceptable but it depends, I am doing this and this doesn’t cause any issue to a point that it is unacceptable.

1 Like

Thanks, It Worked A Treat And Didn’t Really Cause Any Serious Performance Loss.

Great, if clients are not happy with audio being stopped then you can do pause/resume audio producer. But I think people find it more appropriate if you aren’t capturing anything from camera/mic when you are not supposed to. At the end it all depends on the requirements.

If google meet is keeping the audio captured even when muted then it means that there is not much of an issue even if we keep the audio captured if the user is aware of it.
Have you noticed google meet, zoom notifying you to turn on the audio when you are speaking and forgot to turn on the audio? How they detect it that you are speaking? They will be either keeping the audio running in the background to or using video to detect if person is speaking but the former one seems the reason.

Absolutely, I Also Think That They Keep The Audio Coming Even When It’s Muted. Anyways, The Camera Light On Video Is The Main Issue Due To Which We Have To Stop Everything And Start Again. It Would Be Better Off If These Browsers Disabled Camera Light On Track Disable. Maybe They Will Implement This In Future :slight_smile:

I don’t think this will be implemented as it is not related to browser, it is related to the device itself and till we keep the stream captured it keep the light on, depends on the device.