WebRTC: How to determine if a remote user has disabled their video track?

I have a button to disable the local video track:

button.onclick = function(){
    mediaStream.getVideoTracks()[0].enabled =
     !(mediaStream.getVideoTracks()[0].enabled);
}

      

I want to be able to detect this on the remote side so that I can disable the view with a user friendly image instead of showing a black screen.

Are there any events or any stream properties that the remote user can check against their local stream object that indicate that another user has disabled their video?

+3


source to share


1 answer


No, there is no direct way to identify the remote video mute condition.
You need to transmit video disabled event to remote user with alarm (over ws), or you can use data feed to transmit video disabled / enabled events.



You can predict peerConnection statistics based on remote video states, but they are affected by bandwidth / network fluctuations.
And furthermore, the browser will send some video data (blank / black frames) when we disable ( mediaStream.getVideoTracks()[0].enabled = 0

) the video track.

+4


source







All Articles