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:

  1. 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.
  2. Select the type of visibility control to use and press on the corresponding "Hide" button.
  3. Notice how in both cases the audio stops playing.
    1. The media element becomes "paused".
    2. The AudioContext becomes "interrupted".
  4. Also notice that, while hidden, pressing on the "Play" button has no effect. Attempting to play in this situation will:
    1. Make media elements throw a NotAllowed exception.
    2. Make AudioContexts throw a InvalidStateError exception.
  5. Press on the "Show" button to make the media element and AudioContext visible again.
  6. 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: