PictureInPictureWindowHandle Class

The handle of an open Picture-in-Picture window, with which the user agent changes its size or closes it (e.g. the user resizes or closes the floating window). Its methods can be called from any thread: the changes are applied by a task of the event loop of the window that opened it.

public sealed class PictureInPictureWindowHandle

Properties

NameDescription
ClosedGets a task that completes once the window is closed (by the page, the user agent or the backend).
IsClosedGets whether the window is closed.

Gets a task that completes once the window is closed (by the page, the user agent or the backend).

public Task Closed { get; }

Property value

Task

Gets whether the window is closed.

public bool IsClosed { get; }

Property value

bool

Methods

NameDescription
Close()Closes the window (e.g. the user closed it): the video leaves Picture-in-Picture, or the document window is closed.
Resize(PictureInPictureWindowSize)Changes the size of the window (e.g. the user resized it): the page is notified with a resize event. The size is clamped to [1, 16384] CSS pixels.

Closes the window (e.g. the user closed it): the video leaves Picture-in-Picture, or the document window is closed.

public void Close()

Resize(PictureInPictureWindowSize)

UserAgentUIBackend.PictureInPicture.cs

Changes the size of the window (e.g. the user resized it): the page is notified with a resize event. The size is clamped to [1, 16384] CSS pixels.

public void Resize(PictureInPictureWindowSize size)

Parameters

size PictureInPictureWindowSize
The new size, in CSS pixels.