navigator.getAutoplayPolicy() reports whether autoplay of media or Web Audio is allowed, allowed-muted, or disallowed (MDN). Use it to mute videos or show a Play button instead of guessing the browser’s rules.
Pass the required arguments shown below. Check return values and browser support before you rely on the result.
Syntax
Call navigator.getAutoplayPolicy. Start with this line.
JavaScript
navigator.getAutoplayPolicy(arg)
Call
What it does
navigator.getAutoplayPolicy(arg)
Primary signature.
navigator.getAutoplayPolicy(...)
Call with the arguments your case needs.
Built into the browser. Call getAutoplayPolicy(...) on a Navigator — no import required.
Library declarations
JavaScript
navigator.getAutoplayPolicy(arg)
Parameters
This member has no parameters beyond those shown in the signature.
Return Value
Return Value
Description
*
"allowed" | "allowed-muted" | "disallowed"
JavaScript Examples
Example 1 — Feature Detection
MDN-style support check before reading any policy.
JavaScript
if (!navigator.getAutoplayPolicy) {
console.log("navigator.getAutoplayPolicy() not supported.");
} else {
console.log("navigator.getAutoplayPolicy() is supported.");
}
getAutoplayPolicy not supported
(or type/element policy strings; they match on first load)
How It Works
Create or select an element. Pass that object, not the type string.
Compare with the type. On first load they usually match.
Prefer element before play. After interaction, it can be more accurate.
Apply mute to that element. Same allowed-muted rule as the type check.
Compatibility
Browser Support
navigator.getAutoplayPolicy() is part of the Autoplay Policy Detection API. MDN marks it Experimental and not Baseline. Strongest on Firefox (~112+); many Chromium and Safari builds do not expose it. Always feature-detect.
✓ Experimental · Not Baseline
Navigator.getAutoplayPolicy()
Returns allowed / allowed-muted / disallowed for media or Web Audio.
LimitedExperimental
Mozilla FirefoxgetAutoplayPolicy from ~112+
Supported
Google ChromeOften missing — feature-detect
Unavailable
Microsoft EdgeOften missing — feature-detect
Unavailable
Apple SafariNo support (typical)
Unavailable
OperaFollow Chromium — usually missing
Unavailable
Internet ExplorerNo support
Unavailable
getAutoplayPolicy()Limited
Bottom line: Detect the API, configure mute or Play from the result, and never depend on autoplay alone when the method is missing.
Frequently Asked Questions
It returns a string describing whether autoplay is allowed, allowed only when muted (allowed-muted), or disallowed — for media elements / audio contexts as a type, or for a specific HTMLMediaElement or AudioContext.
MDN marks it Experimental. It is not Deprecated or Non-standard. Always feature-detect and keep a Play-button fallback when the API is missing.
One of: "allowed", "allowed-muted", or "disallowed".
Autoplay is allowed only for inaudible media — no audio track, or audio that has been muted. Apps often mute a video so it can still autoplay.
MDN recommends calling on page load (or before creating media) to configure autoplay. There is no event when the policy changes after user interaction, so also check again before play if needed.
Passing "mediaelement" returns the broad type policy. Passing a video/audio element returns that item’s policy, which can differ after the user has interacted with the page.