Permissions-Policy: autoplay directive
Experimental:This is anexperimental technology
Check theBrowser compatibility table carefully before using this in production.
The HTTPPermissions-Policy headerautoplay directive controls whether the current document is allowed toautoplay media requested through theHTMLMediaElement interface.
Specifically, where a defined policy blocks use of this feature and there were no user gestures, thePromisereturned byHTMLMediaElement.play() will reject withaDOMException. Theautoplay attribute on<audio> and<video> elements will be ignored.
Note:For more details on autoplay and autoplay blocking, see the articleAutoplay guide for media and Web Audio APIs.
In this article
Syntax
Permissions-Policy: autoplay=<allowlist>;<allowlist>A list of origins for which permission is granted to use the feature. See
Permissions-Policy> Syntax for more details.
Default policy
The default allowlist forautoplay isself.
Specifications
| Specification |
|---|
| HTML> # autoplay-feature> |