PictureInPictureEvent: PictureInPictureEvent() constructor

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The PictureInPictureEvent() constructor returns a new PictureInPictureEvent object.

Syntax

js
new PictureInPictureEvent(type, options)

Parameters

type

A string representing the name of the event. It is case-sensitive and browsers set it to enterpictureinpicture, leavepictureinpicture, or resize.

options

An object that, in addition of the properties defined in Event(), can have the following properties:

pictureInPictureWindow

A PictureInPictureWindow.

Return value

A new PictureInPictureEvent object.

Specifications

Specification
Picture-in-Picture
# dom-pictureinpictureevent-pictureinpictureevent

Browser compatibility

BCD tables only load in the browser

See also