Issue metadata
Sign in to add a comment
|
DOM Moved <video> element is paused (affects Chromecast)
Reported by
nekr.fab...@gmail.com,
Jun 28 2017
|
||||||||||||||||||||||||
Issue descriptionSteps to reproduce the problem: 1. Open https://omroep-pwa-bmrzqpwxnl.now.sh/news/3457428 on Android 2. Start playing video 3. Cast it to Chromecast 4. Hit Android's back button What is the expected behavior? Video keeps playing on Chromecast What went wrong? Video is paused on Chromecast Did this work before? N/A Does this work in other browsers? N/A Chrome version: Channel: beta OS Version: Flash Version: This isn't specific to Chromecast, but mostly affects it. When you DOM-move whatever <video> Chrome pauses it. It seems like this behavior was (accidentally?) kept for Chromecast. So even if you start playing video again immediately after moving, it still will flicker a bit on the Chromecast because of delay. It's important to put out that closing a tab with the <video> or reloading it doesn't stop or pause the media on Chromecast, so behavior with DOM-moved media feels very weird.
,
Jun 28 2017
,
Jun 29 2017
The following repro steps worked for me: 1. Open https://omroep-pwa-bmrzqpwxnl.now.sh/ 2. Click on a video thumbnail to navigate to the video page. 3. Play & cast the video 4. Hit the back button to navigate back Reproduces on Canary 61 and Stable 59.
,
Jun 29 2017
,
Jul 13 2017
The bug seems to occur because of the InvokeLoadAlgorithm in HTMLMediaElement::DidMoveToNewDocument() that has a FIXME before it: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp?rcl=ae67f19c066747ebc8f5cfe2e705b8169b508c21&l=603 git hyper-blame unhelpfully points to a patch by liberato@ that didn't touch that code. Could be foolip@ or acolwell@ who put it in place long time ago? I wonder if we can remove it.
,
Jul 13 2017
Found the original change here: https://chromiumcodereview.appspot.com/19693009/diff/13001/Source/core/html/HTMLMediaElement.cpp
,
Jul 13 2017
Last time I looked at this, it wasn't a trivial change. It's something we would like to do though so it wouldn't be a bad use of time to investigate more but it will not allow us to fix the crash up to stable/beta.
,
Jul 13 2017
Well, it's not the cause of the crash until it's proved to be, just the pause on Chromecast.
,
Jul 13 2017
I don't believe this is cause of the crash. I avoided the crash by stopping using events in MediaElement#remote. I outlined some of the details in the crash issue. I don't remember how exactly, but crash was tied to `connect` event. So now I listen to those events but unsubscribe from them on `connecting` event and start polling state with setInterval() instead.
,
Aug 14 2017
,
Sep 13 2017
This would seem to be the cause of this interop issue found on webcompat.com (not specific to Chromecast): https://webcompat.com/issues/8777 It would be good to address this before more sites come to rely on this auto-pausing quirk. Edge and Gecko do not pause on moving video/audio elements in the DOM (WebKit has its own issue for which I will file a bug). I've attached a testcase in case it helps (but note that this affects not just <video> elements as in the testcase, but also <audio> elements).
,
Sep 13 2017
,
Sep 13 2017
> (WebKit has its own issue for which I will file a bug) WebKit renders empty (black) buffer to Picture-in-Picture video when it's off-dom, i.e. moving it in dom blinks the video. Audio plays fine. Not sure if this is the same issues you planned file.
,
Sep 13 2017
>Not sure if this is the same issues you planned file. No, it looks like WebKit currently restarts a video when I move it around in the DOM, using my above testcase (the video and audio both restart at the beginning). Firefox and Edge simply continue smoothly playing it. I filed this bug: https://bugs.webkit.org/show_bug.cgi?id=176840
,
Oct 18 2017
If this still matter, this issues causes some compatibility issues in frameworks: https://github.com/developit/preact/issues/747 Clearly, moving DOM elements such as video, audio or canvas shouldn't affect its internal (i.e. playing) state.
,
Nov 21 2017
The spec for this is slightly below https://html.spec.whatwg.org/multipage/media.html#time-marches-on, at "When a media element is removed from a Document". In short, removing the media element should pause, but not synchronously, only if it's not reinserted somewhere else, which is the case when moving.
,
Nov 23 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by nekr.fab...@gmail.com
, Jun 28 2017