Open youennf opened 4 years ago
Other specs defining tracks (like webrtc-pc) could also define their specific behavior. For remote webrtc-pc tracks, ending the tracks might also be a possibility.
When page caching has a definition we can simply say to end the track.
A possibility is for local MediaStreamTracks to be ended when page enters the b/f cache.
Since this would presumably queue a task to fire the ended
event on the document, would ended
be fired before entering the b/f/ cache, or only on (potential) revival from it?
The latter seems appealing and most web compatible, since we've generally tried to avoid firing lots of events on navigation.
@youennf Happy to see progress on this in Safari in https://github.com/w3c/webrtc-extensions/issues/200. How does it work there?
In Safari, capture tracks are ended when going to page cache and the ended event is enqueued. It may only fire on revival. There is no specific handling for other tracks, it is up for the source object to do the page cache handling.
Current browsers do not add pages that have MediaStreamTrack to the b/f cache. It would be good to get consensus on how we could end up doing so. A possibility is for local MediaStreamTracks to be ended when page enters the b/f cache. This would simulate capture failures, which can always happen.