| Summary: | Unplugging headphones causes remote media to fail/freeze in iOS 13.4 | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | daginge |
| Component: | WebRTC | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | Major | CC: | dustin.greif, eric.carlson, feross, jer.noble, mawojtcz, milen.yordanov, oscar.divorraescoda, simon.fraser, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 13 | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 13 | ||
|
Description
daginge
2020-03-26 05:55:09 PDT
Strangely, while Confrere and Basic Peer Connection Demo breaks every time for me, the restart ICE demo does not: https://webrtc.github.io/samples/src/content/peerconnection/restart-ice/. Could this be because of the muted property and autoplay? Confirmed. If the video elements muted property is true, the remote video does not fail when unplugging the headphones. Smells like autoplay. Found a better workaround.
videoElem.addEventListener("pause", () => { videoElem.play() })
Until we try to improve our heuristics, there are some alternatives that might help: 1. Make sure to call play() for each video element as part of click a event. This will remove the autoplay restrictions. Suspend/resume should then work fine. 2. Register a pause event handler. When pause is set and play rejects, mute the media elements and call play. This should allow seeing the video tracks. Add some UI to ask users to play audio/unmute audio. User will click, you can then unmute the elements/call play on all elements. 3. For multi party calls where capture is not on, you might want to keep a buffer of html media elements. On click event, call play on all of these media elements. They do not need to be set to a given src. When you have some media stream to attach, set srcObject and you should be good. *** This bug has been marked as a duplicate of bug 216389 *** |