Deal with empty video track in a call


#1

Situation: I am calling a number (conference, or just a hello world audio message), indicating that I want to use video (if supported) using media constraints.
Result: The RTCPeerConnection fires the track event with both a video and an audio track, even when there is no video to play. The video track is inactive.

Question: Is there a way to either disable adding this redundant video track, or to identify it as an unused video track? I could look at the muted attribute, but that is set only after a few seconds. I also tried to add the audio track and video track together in one MediaStream, but this somehow disables the audio, while the track is still active. Audio works fine if I add the audio track to its own separate MediaStream.


#2

By the way: the way the cyber mega demo deals with this is by checking the video width of the played video, before activating a view. Otherwise it would have the same problem. Something like:
if (video.videoWidth < 10 || video.videoHeight < 10) {}