Fullscreen
Fullscreen state and actions for the player store
Controls fullscreen mode. Tries the container element first, falls back to the media element.
API Reference
State
| Property | Type | Details |
|---|---|---|
fullscreen | boolean | |
| ||
fullscreenAvailability | 'available' | 'unavailable' | 'unsupported' | |
| ||
Actions
| Action | Type | Details |
|---|---|---|
requestFullscreen | () => Promise<void> | |
| ||
exitFullscreen | () => Promise<void> | |
| ||
Selector
Pass selectFullscreen to PlayerController to subscribe to fullscreen state. Returns undefined if the fullscreen feature is not configured.
import { createPlayer, MediaElement, selectFullscreen } from '@videojs/html';
import { videoFeatures } from '@videojs/html/video';
const { PlayerController, context } = createPlayer({ features: videoFeatures });
class FullscreenButton extends MediaElement {
readonly #fullscreen = new PlayerController(this, context, selectFullscreen);
}