Skip to content

Commit

Permalink
[zh-CN]: add translation for Window.documentPictureInPicture (#23635)
Browse files Browse the repository at this point in the history
  • Loading branch information
skyclouds2001 authored Oct 9, 2024
1 parent d48e3c1 commit c0a5fca
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions files/zh-cn/web/api/window/documentpictureinpicture/index.md
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)

0 comments on commit c0a5fca

Please sign in to comment.