v137 · multimedia

Pause media playback on not-rendered iframes

Adds a "media-playback-while-not-rendered" permission policy to allow embedder websites to pause media playback of embedded iframes which aren't rendered - i.e. have their "display" property set to "none". This should allow developers to build more user-friendly experiences and to also improve the performance by letting the browser handle the playback of con

concepts

  1. Iframe Pause

    Media in non-rendered iframes auto-pauses. Stops the classic 'audio playing from invisible iframe' bug class.

  2. Permission Allow

    Two iframes side by side — one with allow="media-playback-while-not-visible", one without. Hide both and compare which keeps playing. The escape hatch music apps need.

  3. Lifecycle Tracer

  4. Visibility Media Controller

    Two simulated media tracks in iframes — toggle one to display:none, the other to visibility:hidden — and watch playback pause automatically. Resume by restoring visibility. Every state change is logged with a timestamp.

    Live iframe inside a scroller. Toggle display, visibility, hidden attr, scroll the frame off-screen; the tracer logs every paint state and audio event Chrome 137 triggers. State matrix lists every case.

why it shipped

Web applications that host embedded media content via iframes may wish to respond to application input by temporarily hiding the media content. These applications may not want to unload the entire iframe when it's not rendered since it could generate user-perceptible performance and experience issues when showing the media content again. At the same time, the user could have a negative experience if the media continues to play and emit audio when not rendered. This proposal aims to provide web applications with the ability to control embedded media content in such a way that guarantees their u

references