Document.pictureInPictureElement is a read-only property that returns the Element currently shown in picture-in-picture mode in this document, or null if PiP is not active (MDN).
Read the notes below before you get or set this property. Prefer feature detection when support is limited.
Syntax
Use document.pictureInPictureElement. Start with this line.
JavaScript
document.pictureInPictureElement
Call
What it does
document.pictureInPictureElement
Primary signature.
Built into the browser. Read or assign document.pictureInPictureElement — no import required.
Detect the property. Some browsers may omit the Picture-in-Picture API.
Check enabled. Policy or environment can disable PiP even when the API exists.
Gate UI. Hide a “Pop out” button when either check fails.
Limited availability. Always feature-detect in production (MDN).
Compatibility
Browser Support
Document.pictureInPictureElement is part of the Picture-in-Picture API. MDN marks it Limited availability (not Baseline) — support varies across widely used browsers.
✓ Limited availability
Document.pictureInPictureElement
Read-only Element in PiP, or null when inactive — pair with pictureInPictureEnabled and exitPictureInPicture.
VariesNot Baseline
Google ChromeSupported · Desktop & Mobile
Full support
Mozilla FirefoxSupported · Desktop & Mobile
Full support
Apple SafariSupported · macOS & iOS
Full support
Microsoft EdgeSupported · Chromium
Full support
Internet ExplorerNo native support · Use a polyfill
Polyfill
OperaSupported · Modern versions
Full support
Samsung InternetSupported · Android
Full support
Android WebViewSupported · Modern WebView
Full support
pictureInPictureElementFeature-detect
Bottom line: Always feature-detect. Check pictureInPictureEnabled before requestPictureInPicture. Use pictureInPictureElement to know which element is floating and when to call exitPictureInPicture.
Frequently Asked Questions
The Element currently presented in picture-in-picture mode in this document, or null if picture-in-picture mode is not currently in use (MDN).
No. MDN marks it as Limited availability (not Baseline), but not Deprecated, Experimental, or Non-standard. Feature-detect before relying on it in production.
When PiP is not active, when there is no associated PiP element, or when the element is from an iframe (MDN).
No meaningful assignment. The property is read-only; modifying it does not throw even in strict mode — the setter is a no-operation and is ignored (MDN).
MDN: if document.pictureInPictureElement is truthy, call document.exitPictureInPicture(). Users can also close PiP with browser UI.
fullscreenElement returns the element in fullscreen mode. pictureInPictureElement returns the element in the floating PiP window. They are separate APIs.