diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index 0c2aa3033297df9..12a48b44674e4c5 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7564,7 +7564,8 @@ /en-US/docs/Web/API/DocumentOrShadowRoot/fullscreenElement /en-US/docs/Web/API/Document/fullscreenElement /en-US/docs/Web/API/DocumentOrShadowRoot/nodeFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot /en-US/docs/Web/API/DocumentOrShadowRoot/nodesFromPoint /en-US/docs/Web/API/DocumentOrShadowRoot -/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureEnabled /en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureElement +/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureElement /en-US/docs/Web/API/Document/pictureInPictureElement +/en-US/docs/Web/API/DocumentOrShadowRoot/pictureInPictureEnabled /en-US/docs/Web/API/Document/pictureInPictureEnabled /en-US/docs/Web/API/DocumentTouch.createTouch /en-US/docs/Web/API/Document/createTouch /en-US/docs/Web/API/DocumentTouch.createTouchList /en-US/docs/Web/API/Document/createTouchList /en-US/docs/Web/API/DocumentTouch/createTouch /en-US/docs/Web/API/Document/createTouch diff --git a/files/en-us/_wikihistory.json b/files/en-us/_wikihistory.json index ef7dc0e00870ba4..d33059b3e1434ef 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -44381,13 +44381,6 @@ "mattwojo" ] }, - "Web/API/DocumentOrShadowRoot/pictureInPictureElement": { - "modified": "2020-10-25T11:04:35.581Z", - "contributors": [ - "chrisdavidmills", - "germain" - ] - }, "Web/API/DocumentOrShadowRoot/pointerLockElement": { "modified": "2020-10-15T21:25:15.470Z", "contributors": [ @@ -165819,5 +165812,12 @@ "ziyunfei", "ernestd" ] + }, + "Web/API/Document/pictureInPictureElement": { + "modified": "2020-10-25T11:04:35.581Z", + "contributors": [ + "chrisdavidmills", + "germain" + ] } -} \ No newline at end of file +} diff --git a/files/en-us/web/api/document/exitpictureinpicture/index.html b/files/en-us/web/api/document/exitpictureinpicture/index.html index 96a7b4bed82bd4f..0b0db0fa56be9a2 100644 --- a/files/en-us/web/api/document/exitpictureinpicture/index.html +++ b/files/en-us/web/api/document/exitpictureinpicture/index.html @@ -82,6 +82,6 @@
true
only if this document is synthetic, such as a standalone image, video, audio file, or the like.The
- DocumentOrShadowRoot.pictureInPictureElement
read-only
- property returns the {{ domxref("HTMLVideoElement") }} that is currently being
+ Document.pictureInPictureElement
read-only
+ property returns the {{ domxref("Element") }} that is currently being
presented in picture-in-picture mode in this document, or null
if
picture-in-picture mode is not currently in use.
var video = document.pictureInPictureElement;+ class="brush: js">document.pictureInPictureElement;
A reference to the {{domxref("HTMLVideoElement")}} object that's currently in +
A reference to the {{domxref("Element")}} object that's currently in
picture-in-picture mode; if picture-in-picture mode isn't currently in use by the
document
, the returned value is null
.
This example presents a function,
- Document.exitPictureInPicture()
,
+
This example presents a function, exitPictureInPicture()
,
which tests the value returned by pictureInPictureElement
. If the document
is in picture-in-picture mode (pictureInPictureElement
isn't
- null
), exitPictureInPicture()
is run to exit
+ null
), Document.exitPictureInPicture()
is run to exit
picture-in-picture mode.
function exitPictureInPicture() { @@ -57,24 +55,18 @@Specifications
Specification -Status -Comment - {{SpecName("Picture-in-Picture", - "#dom-documentorshadowroot-pictureinpictureelement", - "Document.pictureInPictureElement")}} -{{Spec2("Picture-in-Picture")}} -Initial definition +{{SpecName("Picture-in-Picture", "#dom-documentorshadowroot-pictureinpictureelement", "Document.pictureInPictureElement")}} Browser compatibility
-{{Compat("api.DocumentOrShadowRoot.pictureInPictureElement")}}
+{{Compat("api.Document.pictureInPictureElement")}}
See also
diff --git a/files/en-us/web/api/document/pictureinpictureenabled/index.html b/files/en-us/web/api/document/pictureinpictureenabled/index.html index bf1cda7d2945dea..ff72dac0167c7be 100644 --- a/files/en-us/web/api/document/pictureinpictureenabled/index.html +++ b/files/en-us/web/api/document/pictureinpictureenabled/index.html @@ -82,6 +82,6 @@See also
pictureInPictureEnabled
property tells you whether or not it is possible to engage picture-in-picture mode. This is false
if picture-in-picture mode is not available for any reason (e.g. the "picture-in-picture"
feature has been disallowed, or picture-in-picture mode is not supported).pictureInPictureElement
property tells you which {{DOMxRef("Element")}} is currently being displayed in the floating window. If this is null
, the document has no node currently in picture-in-picture mode.pictureInPictureElement
property tells you which {{DOMxRef("Element")}} is currently being displayed in the floating window (or in the shadow DOM). If this is null
, the document (or shadow DOM) has no node currently in picture-in-picture mode.Document.exitPictureInPicture
{{Compat("api.Document.exitPictureInPicture")}}
-DocumentOrShadowRoot.pictureInPictureElement
Document.pictureInPictureElement
{{Compat("api.DocumentOrShadowRoot.pictureInPictureElement")}}
+{{Compat("api.Document.pictureInPictureElement")}}
PictureInPictureWindow
ShadowRoot
.ShadowRoot
— either open
or closed
. This defines whether or not the shadow root's internal features are accessible from JavaScript.The pictureInPictureElement
read-only property of the
+{{domxref("ShadowRoot")}} interface returns the {{domxref("Element")}} that is currently being
+presented in picture-in-picture mode in this shadow tree, or null
if
+picture-in-picture mode is not currently in use.
shadowRoot.pictureInPictureElement+ +
A reference to the {{domxref("Element")}} object that's currently in
+ picture-in-picture mode, or, if picture-in-picture mode isn't currently in use by the
+ shadow tree, the returned value is null
.
let customElem = document.querySelector('my-shadow-dom-element'); +let shadow = customElem.shadowRoot; +let pipElem = shadow.pictureInPictureElement;+ +
Specification | +
---|
{{SpecName('Picture-in-Picture','#dom-documentorshadowroot-pictureinpictureelement', 'pictureInPictureElement')}} | +
{{Compat("api.ShadowRoot.pictureInPictureElement")}}
+ +