Intent to Implement and Ship: HTMLMediaElement.play() retuns a promise

79 views
Skip to first unread message

Mounir Lamouri

unread,
Feb 1, 2016, 11:20:12 AM2/1/16
to blin...@chromium.org
Contact emails:
mlam...@chromium.org

Spec:
WHATWG's HTML spec, more specifically:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play

Summary:
This is allowing a simpler flow to know whether playback started or
whether it failed. It also allows the UA to reject the promise if
playback is not allowed in the current context, solving issues websites
have to detect whether user gesture requirements blocked the playback.
At the Chrome Dev Summit this feature has been requested by Youtube and
JWPlayer.

Interoperability and Compatibility Risk:
Opera, Mozilla and Apple expressed support for the feature in the GitHub
issue: https://github.com/whatwg/html/issues/505
The feature has good cross-browser support (no words from Microsoft).
There is a small risk because we are changing the "signature" of a
heavily used method. However, we are switching from returning undefined
to returning a promise so it should be forward compatible.

Ongoing technical constraints:
None.

Will this feature be supported on all six Blink platforms:
Yes.

OWP launch tracking bug:
https://crbug.com/579541

Link to entry on the feature dashboard:
https://www.chromestatus.com/feature/5920584248590336

Requesting approval to ship?
Yes

Thanks to Philip Jägenstedt for his help with the spec change.

-- Mounir

Philip Jägenstedt

unread,
Feb 1, 2016, 11:30:01 AM2/1/16
to Mounir Lamouri, blink-dev
I am very partial, but LGTM1 :)

For some trivia, WebKit originally threw an exception when the user
gesture check failed, but dropped the exception for obvious reasons.
With a promise, we can revive this in a safer form.
> --
> You received this message because you are subscribed to the Google Groups "blink-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
>

Dimitri Glazkov

unread,
Feb 1, 2016, 11:30:32 AM2/1/16
to Philip Jägenstedt, Mounir Lamouri, blink-dev
LGTM2.

Chris Harrelson

unread,
Feb 1, 2016, 5:46:54 PM2/1/16
to Dimitri Glazkov, Philip Jägenstedt, Mounir Lamouri, blink-dev
LGTM3
Reply all
Reply to author
Forward
0 new messages