#1084: media-playback-while-not-visible Permission Policy

Visit on Github.

Opened Apr 23, 2025

こんにちは TAG-さん!

I'm requesting an early TAG design review of "media-playback-while-not-visible" permission policy.

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 users have a good experience when the iframe's render status is changed. The "media-playback-while-not-visible" permission policy would pause any media being played by iframes which are not currently rendered. For example, this would apply whenever the iframe’s "display" CSS property is set to "none" or when the "visibility" property is set to "hidden" or "collapse".

You should also know that...

Answer to the privacy questionnaire's question 1: What information does this feature expose, and for what purposes?

  • There is a possibility that the embedded could infer that the permission policy is in effect and it is being hidden. For example, a webpage could have both an HTMLVideoElement and an AudioContext playing audio simultaneously. If at some point they both get, respectively, paused and interrupted within a short time frame; then, the website could infer that an ancestor frame is applying the permission policy on it and that it has been hidden by one of the ancestors. Nevertheless, we believe that this would be very low impact, because a web page could make a similar observation by monitoring when it’s unloaded as well as via the IntersectionObserver API.

Discussions