Document.pictureInPictureEnabled is a read-only Boolean that is true when a video may enter picture-in-picture (floating window) via HTMLVideoElement.requestPictureInPicture(), otherwise false (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use document.pictureInPictureEnabled. Start with this line.
JavaScript
document.pictureInPictureEnabled
Call
What it does
document.pictureInPictureEnabled
Primary signature.
Built into the browser. Read or assign document.pictureInPictureEnabled — no import required.
Library declarations
JavaScript
document.pictureInPictureEnabled
Parameters
Parameter
Description
Permissions-Policy
Optional. Can deny PiP (MDN)
Return Value
Return Value
Description
*
Boolean (true / false)
JavaScript Examples
Example 1 — Read pictureInPictureEnabled
Log whether picture-in-picture is available in the current document.
JavaScript
console.log(document.pictureInPictureEnabled);
// true or false
Read the Boolean. No arguments — access document.pictureInPictureEnabled.
Interpret true. A video may call requestPictureInPicture().
Interpret false. Do not offer PiP (or explain why).
Policy matters. Permissions-Policy can turn support off (MDN).
Example 2 — Guard Before requestPictureInPicture() (MDN)
Check availability first, then enter — or log a friendly message.
JavaScript
function requestPictureInPicture(videoElement) {
if (document.pictureInPictureEnabled) {
videoElement.requestPictureInPicture();
} else {
console.log("Your browser cannot use picture-in-picture right now");
}
}
// Demo without starting real PiP:
if (document.pictureInPictureEnabled) {
console.log("PiP is available — safe to call requestPictureInPicture().");
} else {
console.log("Your browser cannot use picture-in-picture right now");
}
PiP is available — safe to call requestPictureInPicture().
How It Works
Gate the call. Only request PiP when the flag is true.
Avoid failed attempts. When false, skip requestPictureInPicture().
Tell the user. MDN’s message pattern keeps UX clear.
Still need a gesture. Browsers usually require a click even when enabled.
Example 3 — Enabled vs Currently Active
Availability is not the same as “in picture-in-picture now.”
JavaScript
const allowed = document.pictureInPictureEnabled;
const active = document.pictureInPictureElement !== null;
console.log(allowed); // can we enter PiP?
console.log(active); // are we in PiP now?
// Common combo: allowed && !active → show "Enter PiP"
Read state.pictureInPictureElement !== null answers “are we in PiP?”
Typical combo. Allowed + not active → show an Enter control.
Do not mix them up. A page can allow PiP and still not be in PiP.
Compatibility
Browser Support
Document.pictureInPictureEnabled is marked Limited availability on MDN (not Baseline). It is not Deprecated, Experimental, or Non-standard — still feature-detect in production.
✓ Limited availability · Not Baseline
Document.pictureInPictureEnabled
Read-only Boolean — true when HTMLVideoElement.requestPictureInPicture() is allowed for this document.
LtdLimited availability
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
pictureInPictureEnabledLimited
Bottom line: Check document.pictureInPictureEnabled before calling requestPictureInPicture(). Pair with pictureInPictureElement for current state, and exit with document.exitPictureInPicture().
Frequently Asked Questions
A boolean: true if a video can enter picture-in-picture via HTMLVideoElement.requestPictureInPicture(), or false if PiP is not available (MDN).
No. MDN does not mark it Deprecated, Experimental, or Non-standard. It is Limited availability (not Baseline), so feature-detect in production.
pictureInPictureEnabled asks whether PiP is allowed at all. pictureInPictureElement tells you which element (if any) is currently in picture-in-picture.
When the browser cannot use PiP here, or when a Permissions-Policy disables picture-in-picture. MDN: available by default unless denied by policy.
The property is read-only, but assigning does not throw — even in strict mode. The setter is a no-operation and is ignored (MDN).
Yes. MDN recommends checking first so you can show a friendly message instead of a failed request.