-
Notifications
You must be signed in to change notification settings - Fork 3.6k
media: Fix the order of events for autoplay media #56014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
media: Fix the order of events for autoplay media #56014
Conversation
Following the HTML specification, the order of events for autoplaying media files (<video autoplay>) has been corrected: - carplay, canplaythrough, play, playing https://html.spec.whatwg.org/multipage/#ready-states:event-media-canplaythrough WhatWG PR: whatwg/html#1409 Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
|
WPT live status |
|
What are the expected results of the browsers after changing the test this way? Is Webkit the only engine that implements the specification order right now? |
The expected order of the events for autoplay media is according to specification:
The most of major browsers doesn't follow the specification (except Safari, but it has another issue which is affecting final results) Chromium:
The expected results after changing the test: 10/10 -> 6/10 Firefox:
The expected results after changing the test: 10/10 -> 6/10 Safari:
The expected results after changing the test: 4/10 -> 4/10 because the
|
|
There was discussion about the event ordering - WICG/interventions#23 (comment) |
|
Ok, changing the test to reflect the current specification seems like the right choice. Whether the specification should be changed to reflect the actual browser implementations is probably also worth a discussion somewhere else! |
Follow the HTML specification, queue a media element task to fire `canplaythrough` event in expected order (after `canplay`) on the changing the ready state to `HAVE_ENOUGH_DATA` which align the event ordering for non-autoplay and autoplay media. See https://html.spec.whatwg.org/multipage/#ready-states%3Aevent-media-canplaythrough The associated WPT PR: web-platform-tests/wpt#56014 Testing: Improvements in the following tests - html/semantics/embedded-content/media-elements/ready-states/autoplay.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
Follow the HTML specification, queue a media element task to fire `canplaythrough` event in expected order (after `canplay`) on the changing the ready state to `HAVE_ENOUGH_DATA` which align the event ordering for non-autoplay and autoplay media. See https://html.spec.whatwg.org/multipage/#ready-states%3Aevent-media-canplaythrough The associated WPT PR: web-platform-tests/wpt#56014 Testing: Improvements in the following tests - html/semantics/embedded-content/media-elements/ready-states/autoplay.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
…40685) Follow the HTML specification, queue a media element task to fire `canplaythrough` event in expected order (after `canplay`) on the changing the ready state to `HAVE_ENOUGH_DATA` which align the event ordering for non-autoplay and autoplay media. See https://html.spec.whatwg.org/multipage/#ready-states%3Aevent-media-canplaythrough The associated WPT PR: web-platform-tests/wpt#56014 Testing: Improvements in the following tests - html/semantics/embedded-content/media-elements/ready-states/autoplay.html Signed-off-by: Andrei Volykhin <andrei.volykhin@gmail.com>
Following the HTML specification, the expected order of events for autoplaying media tests (
<video autoplay>) has been corrected:canplay,canplaythrough(same as before)canplay,canplaythrough,play,playing(canplaythroughshould be right aftercanplay, not afterplaying)https://html.spec.whatwg.org/multipage/#ready-states:event-media-canplaythrough
WhatWG PR: whatwg/html#1409