Implement `document.autoplayPolicy` API
Categories
(Core :: Audio/Video: Playback, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox66 | --- | fixed |
People
(Reporter: alwu, Assigned: alwu)
References
Details
(Keywords: dev-doc-complete)
Attachments
(2 files)
`document.autoplayPolicy` returns a enum string that can change overtime based on user session activity [1]: - “allowed” if autoplay is currently allowed. - “allowed-muted” if muted video autoplay is currently allowed. - “disallowed” is autoplay is not current allowed. - “prompt” if autoplay will trigger a prompt [1] https://github.com/WICG/autoplay/issues/1
Assignee | ||
Comment 1•6 years ago
|
||
`document.autoplayPolicy` returns a enum string that can change overtime based on user session activity: - “allowed” if autoplay is currently allowed. - “allowed-muted” if muted video autoplay is currently allowed. - “disallowed” is autoplay is not current allowed. - “prompt” if autoplay will trigger a prompt
Assignee | ||
Comment 2•6 years ago
|
||
Before fixing bug1493766, we can't write tests because now AutoplayPolicy::IsAllowedToPlay() would return incorrectly result under some situaions. I will write the wpt-test after fixing bug1493766.
Assignee | ||
Comment 3•6 years ago
|
||
The proposal [1] defines that `document.autoplayPolicy` returns a single enum string, but it doesn't meet our current implementation. “allowed-muted” and “prompt” can exist at the same time. Therefore, we can't implement this API now, we need to wait for the decision about whether shipping the doorhanger. If not, we can implement this single enum version, but if we want to ship with doorhanger, we need to modify the proposal in order to make API return multiple enums strings.
Updated•6 years ago
|
Updated•6 years ago
|
Updated•5 years ago
|
Assignee | ||
Comment 4•5 years ago
|
||
Assignee | ||
Comment 5•5 years ago
|
||
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/63c3828351f0 part1 : implement 'document.autoplayPolicy'. r=baku,cpearce https://hg.mozilla.org/integration/autoland/rev/3420cf8f79a9 part2 : add test. r=cpearce
Comment 7•5 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/63c3828351f0
https://hg.mozilla.org/mozilla-central/rev/3420cf8f79a9
Comment 8•5 years ago
|
||
:cmills-- when we get to the docs for this one, I'll take it.
Comment 9•5 years ago
|
||
(In reply to Eric Shepherd [:sheppy] from comment #8)
:cmills-- when we get to the docs for this one, I'll take it.
WFM; I've added you to the relevant MDN roadmap card: https://trello.com/c/4emMB6Y8/146-autoplay-api-fx-66
Comment 10•5 years ago
|
||
Again, I don't think this is available in 66; see https://bugzilla.mozilla.org/show_bug.cgi?id=1487844#c9. I could be wrong.
Assignee | ||
Comment 11•5 years ago
|
||
This API is controled by the pref "dom.media.autoplay.autoplay-policy-api", which is default off. If user turns on this pref in 66, then they can use the API no matter whether we enable blocking autoplay or not.
Comment 12•5 years ago
|
||
I've added this to the "experimental features in Firefox" page. It's currently mentioned on the Fx for 66 page, but can be removed if we decide to.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 13•5 years ago
|
||
(In reply to Eric Shepherd [:sheppy] from comment #12)
I've added this to the "experimental features in Firefox" page. It's currently mentioned on the Fx for 66 page, but can be removed if we decide to.
It sounds good to me to mention that this API is just an experimental feature which hasn't be a part of the offical spec, thank you.
Comment 14•5 years ago
|
||
The docs for this one sound done, for now.
Description
•