Skip to content
FrameworkStyle

Remote Playback

Remote playback state and actions for the player store

Controls remote playback to devices like Chromecast (Chromium) and AirPlay (Safari). Exits fullscreen before initiating a remote playback session.

API Reference

State

PropertyTypeDetails
remotePlaybackState'disconnected' | 'connecting' | 'connected'
remotePlaybackAvailability'available' | 'unavailable' | 'unsupported'

Actions

ActionTypeDetails
toggleRemotePlayback() => Promise<void>

Selector

Pass selectRemotePlayback to PlayerController to subscribe to remote playback state. Returns undefined if the remote playback feature is not configured.

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

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

class CastButton extends MediaElement {
  readonly #remotePlayback = new PlayerController(this, context, selectRemotePlayback);
}