diff --git a/files/en-us/_redirects.txt b/files/en-us/_redirects.txt index c4d5b0b67f353b0..4af8c7f4b98bfb3 100644 --- a/files/en-us/_redirects.txt +++ b/files/en-us/_redirects.txt @@ -7566,7 +7566,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 48457801cde847e..1f3b56e3896edd0 100644 --- a/files/en-us/_wikihistory.json +++ b/files/en-us/_wikihistory.json @@ -44405,13 +44405,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": [ @@ -165876,5 +165869,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")}}
+ +