blob: cdcf4b19cc29303314f0d5d4b0a0402d277cffdc (
plain)
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
|
---
title: ShadowRoot.pictureInPictureElement
slug: Web/API/ShadowRoot/pictureInPictureElement
tags:
- API
- プロパティ
- リファレンス
- ShadowRoot
- ウェブコンポーネント
- シャドウ DOM
browser-compat: api.ShadowRoot.pictureInPictureElement
---
{{APIRef("Shadow DOM")}}
**`pictureInPictureElement`** は {{domxref("ShadowRoot")}} インターフェイスの読み取り専用プロパティで、このシャドウツリー内で現在、ピクチャインピクチャモードで表示されている要素 ({{domxref("Element")}}) を返します。現在、ピクチャインピクチャモードが使用されていない場合は `null` を返します。
## 構文
```js
shadowRoot.pictureInPictureElement
```
### 値
現在ピクチャインピクチャモードになっている {{domxref("Element")}} オブジェクトへの参照、またはピクチャインピクチャモードが現在シャドウツリーで使われていない場合は `null` が返されます。
## 例
```js
let customElem = document.querySelector('my-shadow-dom-element');
let shadow = customElem.shadowRoot;
let pipElem = shadow.pictureInPictureElement;
```
## 仕様書
{{Specifications}}
## ブラウザーの互換性
{{Compat}}
## 関連情報
- {{domxref("Document.pictureInPictureElement")}}
|