/
index.md
47 lines (32 loc) · 1.11 KB
/
index.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
title: "Window: documentPictureInPicture property"
short-title: documentPictureInPicture
slug: Web/API/Window/documentPictureInPicture
page-type: web-api-instance-property
status:
- experimental
browser-compat: api.Window.documentPictureInPicture
---
{{APIRef}}{{seecompattable}}{{SecureContext_Header}}
The **`documentPictureInPicture`** read-only property of the
{{domxref("Window")}} interface returns a reference to the {{domxref("DocumentPictureInPicture")}} object for the current document context.
## Value
A {{domxref("DocumentPictureInPicture")}} object instance.
## Examples
```js
const videoPlayer = document.getElementById("player");
// ...
// Open a Picture-in-Picture window.
await window.documentPictureInPicture.requestWindow({
width: videoPlayer.clientWidth,
height: videoPlayer.clientHeight,
});
// ...
```
## Specifications
{{Specifications}}
## Browser compatibility
{{Compat}}
## See also
- {{domxref("Document Picture-in-Picture API", "Document Picture-in-Picture API", "", "nocode")}}
- [Using the Document Picture-in-Picture API](/en-US/docs/Web/API/Document_Picture-in-Picture_API/Using)