Document.pictureInPictureEnabled is a read-only instance property that tells you whether picture-in-picture (PiP) mode is available for this document. Learn how to guard requestPictureInPicture(), how it differs from pictureInPictureElement, Permissions-Policy notes, and five examples with try-it labs.
01
Kind
Read-only property
02
Returns
boolean
03
Means
Can use PiP?
04
vs
PiP element
05
Guard
Before request
06
Status
Limited avail.
Fundamentals
Introduction
Before calling video.requestPictureInPicture(), it helps to know whether the browser will allow it. document.pictureInPictureEnabled answers that question with a simple true or false.
MDN: the read-only property indicates whether or not picture-in-picture mode is available. Picture-in-picture is available by default unless a Permissions-Policy turns it off. It pairs with pictureInPictureElement in the Picture-in-Picture API.
💡
Limited availability
MDN marks this property Limited availability (not Baseline). It is not Deprecated, Experimental, or Non-standard—still feature-detect ("pictureInPictureEnabled" in document) before relying on it.
A read-only instance property on Document that reports Picture-in-Picture API availability—not whether PiP is currently active.
Value — true if a video can enter PiP via requestPictureInPicture(); otherwise false (MDN).
Default — MDN: available by default unless a Permissions-Policy disables it.
Lenient setter — assigning does not throw; the write is ignored (MDN).
Pair with — check before requestPictureInPicture(); use pictureInPictureElement to see the active element.
UI tip — hide or disable PiP buttons when the value is false.
Foundation
📝 Syntax
JavaScript
document.pictureInPictureEnabled
Value
A boolean: true when picture-in-picture can be requested; false when it cannot (MDN).
MDN guard example
JavaScript
function requestPictureInPicture() {
if (document.pictureInPictureEnabled) {
videoElement.requestPictureInPicture();
} else {
console.log("Your browser cannot use picture-in-picture right now");
}
}
Compare
⚖️ Picture-in-Picture Document Properties
Property / method
Returns
Question it answers
document.pictureInPictureEnabled
boolean
Can this document use PiP? (this page)
document.pictureInPictureElement
Element | null
Which element is in PiP right now?
video.requestPictureInPicture()
Promise
Enter PiP (after guard check)
document.exitPictureInPicture()
Promise
Leave PiP
document.fullscreenEnabled
boolean
Parallel check for fullscreen
Cheat Sheet
⚡ Quick Reference
Goal
Code / note
Is PiP allowed?
document.pictureInPictureEnabled
Guard before request
if (document.pictureInPictureEnabled) { ... }
Is PiP active?
document.pictureInPictureElement !== null
Feature detect
"pictureInPictureEnabled" in document
Policy note
May be disabled by Permissions-Policy (MDN)
MDN status
Limited availability (not Baseline)
Snapshot
🔍 At a Glance
Four facts about document.pictureInPictureEnabled.
Type
boolean
Read-only
true
can enter
PiP available
false
blocked
Not allowed
Status
limited
Not Baseline
Compare
📋 pictureInPictureEnabled vs pictureInPictureElement
A boolean is enough to decide whether to show PiP controls in your player UI.
Example 2 — MDN Guard Before requestPictureInPicture()
Only request PiP when the feature is enabled (MDN example).
JavaScript
function requestPictureInPicture() {
if (document.pictureInPictureEnabled) {
videoElement.requestPictureInPicture();
} else {
console.log("Your browser cannot use picture-in-picture right now");
}
}
Button enabled when pictureInPictureEnabled is true
How It Works
Availability is a document-level fact; active PiP state is separate and can change later.
Example 4 — Availability vs Active Element
Enabled means you can enter PiP; the element property means you are in PiP.
JavaScript
console.log("Available?", document.pictureInPictureEnabled);
console.log("Active element?", document.pictureInPictureElement);
// Available can be true while Active element is still null
Document.pictureInPictureEnabled is marked Limited availability on MDN (not Baseline). Feature-detect before production use. Logos use the shared browser-image-sprite.png sprite from this project.
✓ Limited availability · Not Baseline
Document.pictureInPictureEnabled
Read-only boolean — whether picture-in-picture mode is available for this document.
Bottom line: Check pictureInPictureEnabled before requestPictureInPicture(). Pair with pictureInPictureElement to track the active PiP element.
Wrap Up
Conclusion
Document.pictureInPictureEnabled is the availability switch for picture-in-picture. Guard requestPictureInPicture() with it, mirror the fullscreenEnabled pattern, and use pictureInPictureElement once PiP is active.
Check document.pictureInPictureEnabled before requesting PiP (MDN)
Feature-detect with "pictureInPictureEnabled" in document
Disable PiP UI when the value is false
Start PiP only from a user gesture
Track active state with pictureInPictureElement
❌ Don’t
Assign to pictureInPictureEnabled expecting to change policy
Confuse availability with “currently in PiP”
Assume every browser is Baseline for this API
Ignore Permissions-Policy when the value is unexpectedly false
Call requestPictureInPicture() without a fallback message
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about pictureInPictureEnabled
Boolean availability — guard before requesting PiP.
5
Core concepts
✅01
Returns
boolean
API
✓02
true
PiP allowed
Available
🛡03
Guard
before request
MDN
🎬04
vs
PiP element
Active
🔎05
Detect
in document
Safe
❓ Frequently Asked Questions
A boolean: true if a video can enter picture-in-picture and display in a floating window via HTMLVideoElement.requestPictureInPicture(), or false if PiP is not available (MDN).
No. MDN does not mark Document.pictureInPictureEnabled as 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 mode.
When the browser does not support PiP for this document, or when a Permissions-Policy (or similar policy) disables picture-in-picture. MDN notes PiP is available by default unless specified otherwise by a Permissions-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 it first so you can show a friendly message instead of a failed request.
Did you know?
MDN notes that although pictureInPictureEnabled is read-only, assigning to it does not throw—even in strict mode. The setter is ignored. Site owners who need to turn PiP off should use a Permissions-Policy header (or equivalent), not JavaScript assignment.