此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

PictureInPictureEvent:PictureInPictureEvent() 构造函数

有限可用

此特性不属于基线,因为它尚未在主流浏览器中得到支持。

Want more browser support for this feature? Tell us why.

PictureInPictureEvent() 构造函数返回一个新的 PictureInPictureEvent 对象。

语法

js
new PictureInPictureEvent(type, options)

参数

type

表示事件名称的字符串。它区分大小写,浏览器将其设置为 enterpictureinpictureleavepictureinpictureresize

options

除了 Event() 中定义的属性外,该对象还可以具有以下属性:

pictureInPictureWindow

一个 PictureInPictureWindow 对象。

返回值

一个新的 PictureInPictureEvent 对象。

规范

规范
Picture-in-Picture
# dom-pictureinpictureevent-pictureinpictureevent

浏览器兼容性

参见