-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1478208 - Implement HTMLMediaElement.allowedToPlay. r=alwu,bz
Various web authors have expressed desire to know in advance whether autoplay will work. They want this in order to avoid paying the price for downloading media that won't play. Or they want to take other action such as showing a poster image instead. This is of particular interest to Firefox, as we're planning on showing a prompt to ask the user whether they would like a site to play. If sites want to determine whether they can autoplay but avoid the prompt showing, they won't be able to just call play() in Firefox and see whether it works, as that would likely show the prompt if the user doesn't already have a stored permission. We've been working out a spec here: whatwg/html#3617 (comment) This implements what is the consensus to date there; HTMLMediaElement.allowedToPlay, which returns true when a play() call would not be blocked with NotAllowedError by autoplay blocking policies. MozReview-Commit-ID: AkBu0G7uCJ0 UltraBlame original commit: f5f55e363d318effdfd504061c50f87e06301c6f
- Loading branch information
Showing
8 changed files
with
214 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1730,6 +1730,12 @@ mIsCasting | |
aShow | ||
; | ||
} | ||
bool | ||
AllowedToPlay | ||
( | ||
) | ||
const | ||
; | ||
already_AddRefed | ||
< | ||
MediaSource | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,3 +400,19 @@ webaudio | |
false | ||
) | ||
; | ||
user_pref | ||
( | ||
" | ||
media | ||
. | ||
allowed | ||
- | ||
to | ||
- | ||
play | ||
. | ||
enabled | ||
" | ||
true | ||
) | ||
; |