Skip to content
FrameworkStyle

Picture-in-picture

Picture-in-picture state and actions for the player store

Controls picture-in-picture mode.

API Reference

State

PropertyTypeDetails
pipboolean
pipAvailability'available' | 'unavailable' | 'unsupported'

Actions

ActionTypeDetails
requestPictureInPicture() => Promise<void>
exitPictureInPicture() => Promise<void>
togglePictureInPicture() => Promise<void>

Selector

Pass selectPiP to PlayerController to subscribe to picture-in-picture state. Returns undefined if the PiP feature is not configured.

import { createPlayer, MediaElement, selectPiP } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';

const { PlayerController, context } = createPlayer({ features: videoFeatures });

class PiPButton extends MediaElement {
  readonly #pip = new PlayerController(this, context, selectPiP);
}