I'm currently troubleshooting an issue related to streaming live video.
The symptoms I'm seeing appears to be related to this thread:
I've been able to reproduce the problem in two different ways.
The first scenario involves three different web browsers / computers, etc. I'll give these browsers the names Persons A, B, and C. Person A will be the host. Persons A and B are able to see each other. Persons B and C cannot.
The other scenario involves two different web browsers / computers, etc (we'll call them Person A & B). Again, one-to-one peer communication is successfully established, and both users are able to see each other. In this scenario, I had programmatically added some source code so that Person B can dynamically destroy then rebuild the video element (and, in turn, stopping and restarting the web camera). Person B destroying everything yields expected behavior. However, when Person B decides to restart the web camera, Person A is unable to see Person B.
I decided to create event handlers for both the MediaStreamTrack and the video element. In a perfect world, my logs would look like this:
tracks received from peer: (2) [MediaStreamTrack, MediaStreamTrack]
mute event triggered for track: MediaStreamTrack {kind: "audio", id: "...", label: "...", enabled: true, muted: false, …}
mute event triggered for track: MediaStreamTrack {kind: "video", id: "...", label: "...", enabled: true, muted: false, …}
end event triggered for track: MediaStreamTrack {kind: "audio", id: "...", label: "...", enabled: true, muted: false, …}
loadstart event triggered...
onloadedmetadata event triggered...
canplay event triggered...
canplaythrough event triggered...
However, in the event that the receiving user is unable to view the video stream, the onloadedmetadata event is never triggered. Instead, the video media stream track ends up being muted:
tracks received from peer: (2) [MediaStreamTrack, MediaStreamTrack]
mute event triggered for track: MediaStreamTrack {kind: "audio", id: "...", label: "...", enabled: true, muted: false, …}
mute event triggered for track: MediaStreamTrack {kind: "video", id: "...", label: "...", enabled: true, muted: false, …}
loadstart event triggered...
mute event triggered for track: MediaStreamTrack {kind: "video", id: "...", label: "...", enabled: true, muted: true, …}
I would like to understand the variants that could contribute to this type of behavior, and any options that I may have in order to resolve this, if possible. I tried reading through the official WebRTC documentation; however, I really couldn't find any clues. Perhaps I didn't know where to look.
Thanks for your time and consideration.