← Back to release summary

Mute media and defer media events in skipped content-visibility subtrees

Category
Miscellaneous
Type
New or changed feature
Status
Proposed (Chrome Proposed)
Intent stage
None

Summary

Media elements inside a subtree skipped by content-visibility (content-visibility: hidden, or content-visibility: auto while off-screen) are muted, and their media events (play, pause, timeupdate, volumechange, ...) are deferred until the subtree is rendered again. Playback itself continues; events are dispatched in order once the content stops being skipped. This prevents users from hearing audio from content that is not rendered, without requiring authors to manually pause or mute media they hide with content-visibility.

Motivation

Today, audio from a media element keeps playing audibly when its subtree is skipped by content-visibility, even though the content is not rendered. Authors who use content-visibility: hidden to implement show/hide UI (or auto for long scrollable pages) must manually track and mute/pause every media element in the subtree to avoid audio from invisible content. The CSSWG resolved that media in skipped subtrees should be muted and its events deferred: https://github.com/w3c/csswg-drafts/issues/6468#issuecomment-887634200 Spec text for the resolution has not landed yet; part of the goal of prototyping is to validate feasibility and inform the spec edits.

Standards & signals

Ecosystem

Explainers: https://github.com/w3c/csswg-drafts/issues/6468 https://github.com/WICG/display-locking/blob/main/explainers/content-visibility.md

View on chromestatus.com