-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[zh-CN]: add translation for
Window.documentPictureInPicture
(#23635)
- Loading branch information
1 parent
d48e3c1
commit c0a5fca
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
files/zh-cn/web/api/window/documentpictureinpicture/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
title: Window:documentPictureInPicture 属性 | ||
slug: Web/API/Window/documentPictureInPicture | ||
l10n: | ||
sourceCommit: bac20b9ed34bf5b6427ba9274c99c1737dc309ff | ||
--- | ||
|
||
{{APIRef("Document Picture-in-Picture API")}}{{SeeCompatTable}}{{SecureContext_Header}} | ||
|
||
{{domxref("Window")}} 接口的 **`documentPictureInPicture`** 只读属性返回对当前文档上下文的 {{domxref("DocumentPictureInPicture")}} 对象的引用。 | ||
|
||
## 值 | ||
|
||
{{domxref("DocumentPictureInPicture")}} 对象实例。 | ||
|
||
## 示例 | ||
|
||
```js | ||
const videoPlayer = document.getElementById("player"); | ||
|
||
// ... | ||
|
||
// 打开画中画窗口。 | ||
await window.documentPictureInPicture.requestWindow({ | ||
width: videoPlayer.clientWidth, | ||
height: videoPlayer.clientHeight, | ||
}); | ||
|
||
// ... | ||
``` | ||
|
||
## 规范 | ||
|
||
{{Specifications}} | ||
|
||
## 浏览器兼容性 | ||
|
||
{{Compat}} | ||
|
||
## 参见 | ||
|
||
- {{domxref("Document Picture-in-Picture API", "Document Picture-in-Picture API", "", "nocode")}} | ||
- [使用 Document Picture-in-Picture API](/zh-CN/docs/Web/API/Document_Picture-in-Picture_API/Using) |