Calling video.play() before setting src is not reliable |
||||||
Issue descriptionThis JS reliably results in playing video: video.play(); video.src = "bbb.mp4"; This JS reliably loads but does not play the video: video.play(); window.setTimeout(() => video.src = "bbb.mp4", 0); (Similar results can be obtained using promises.) The difference appears to be due to interleaved task scheduling, but I have not fully investigated. I've attached my test files along with the Media log channel output, but reproduction is trivial.
,
Mar 7 2016
You are correct, the first version does not play but the second does. It looks like I also switched the log names, which may have actually been the original source of confusion. While it makes far more sense to set src and then call play(), the fact that some of the Chromium browser_tests are relying on the opposite is not a good sign for the compatibility of a change.
,
Mar 14 2016
I've filed https://github.com/whatwg/html/issues/869, will close this as WontFix until there's a spec change. I couldn't find your GitHub account, can you add yourself if you're interested? You're right that changing this behavior has some risk, I guess we'll have to add use counters if want to try it.
,
Mar 21 2016
Renaming Blink>Video to Blink>Media>Video for better characterization
,
Aug 1 2016
Reopening this because I'm looking into the issue. I can't actually get the video to play after setting the src. Are you all still able to reproduce this?
,
Aug 1 2016
I can still reproduce this exactly on 54.0.2810.2, (noting that the descriptions in the first post are swapped. (It's the second one that plays and the first one that fails.)
,
Aug 2 2016
,
Aug 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e2c683031c305abcb6dab162832f95fa9b71545e commit e2c683031c305abcb6dab162832f95fa9b71545e Author: mlamouri <mlamouri@chromium.org> Date: Thu Aug 04 15:32:36 2016 Change play promises behaviour in the load algorithm. This is implementing the changes from the following whatwg/html PR: https://github.com/whatwg/html/pull/1621 BUG= 592158 , 630622 R=foolip@chromium.org Review-Url: https://codereview.chromium.org/2199363002 Cr-Commit-Position: refs/heads/master@{#409793} [modify] https://crrev.com/e2c683031c305abcb6dab162832f95fa9b71545e/third_party/WebKit/LayoutTests/media/media-play-promise.html [modify] https://crrev.com/e2c683031c305abcb6dab162832f95fa9b71545e/third_party/WebKit/Source/core/html/HTMLMediaElement.cpp
,
Aug 4 2016
|
||||||
►
Sign in to add a comment |
||||||
Comment 1 by phil...@opera.com
, Mar 7 2016