media-playback-while-not-visible permission policy test page
This page is used to experiment with the behavior of the
"media-playback-while-not-visible" permission policy.
To try the feature out, for both cases below, do:
-
If not already playing, click on the "Play" button to start playing
media. Both the HTML Media Element and the Web Audio case should produce
sound.
-
Select the type of visibility control to use and press on the
corresponding "Hide" button.
-
Notice how in both cases the audio stops playing.
- The media element becomes "paused".
- The AudioContext becomes "interrupted".
-
Also notice that, while hidden, pressing on the "Play" button has no
effect. Attempting to play in this situation will:
- Make media elements throw a NotAllowed exception.
- Make AudioContexts throw a InvalidStateError exception.
-
Press on the "Show" button to make the media element and AudioContext
visible again.
-
The AudioContext should be resumed automatically, and pressing on the
"Play" button for the media element should also resume playback.
HTML Media Element
Media element state:
Web Audio AudioContext
AudioContext state: