| name | videojs-v10-html-player-store |
| description | Reference for the Video.js HTML player's `<video-player>` custom element store API — state signals, actions (play/pause/seek/volume/fullscreen/pip/subtitles), lifecycle methods (attach/detach/destroy), feature presets, and feed unload/reload patterns. Activate whenever writing or debugging Video.js player code that accesses `player.store`.
|
Video.js HTML Player — Store API Reference
Further Reference
If you need details not covered here, clone the repo:
git clone https://github.com/videojs/v10/
All state and actions are accessible on the <video-player> element's store:
const player = document.querySelector('video-player');
player.store.state.paused;
player.store.state.play();
Store Lifecycle Methods
These live directly on store (not store.state):
| Method | Description |
|---|
store.target | { media, container } or null |
store.destroyed | Whether the store has been permanently destroyed |
store.attach({ media, container }) | Attach store to a media/container target; triggers all feature attach() callbacks |
store.detach() | Reset all signals + state to initial values; keeps store alive for reuse |
store.destroy() | Permanently destroy the store (aborts setup, detaches, no reuse) |
store.subscribe(callback, options?) | Subscribe to state changes; returns unsubscribe function |
detach() vs destroy():
detach() — unload source, keep player. Use when reusing the element with a new source.
destroy() — permanent teardown. Call player.destroy() on the element to cascade destroy through engines (hls.js/dash.js MSE teardown, blob URL revocation, event listeners).
Playback
player.store.state.paused
player.store.state.ended
player.store.state.started
player.store.state.waiting
player.store.state.play()
player.store.state.pause()
player.store.state.togglePaused()
Source
player.store.state.source
player.store.state.canPlay
player.store.state.loadSource('https://...')
Unload without destroying:
player.store.state.loadSource('');
Time
player.store.state.currentTime
player.store.state.duration
player.store.state.seeking
player.store.state.seek(42)
seek() waits for loadedmetadata if no metadata yet, then seeked. In-flight seeks are auto-cancelled on new source load.
Volume
player.store.state.volume
player.store.state.muted
player.store.state.volumeAvailability
player.store.state.setVolume(0.5)
player.store.state.toggleMuted()
Playback Rate
player.store.state.playbackRates
player.store.state.playbackRate
player.store.state.setPlaybackRate(1.5)
Buffer
player.store.state.buffered
player.store.state.seekable
Fullscreen
player.store.state.fullscreen
player.store.state.fullscreenAvailability
player.store.state.requestFullscreen()
player.store.state.exitFullscreen()
player.store.state.toggleFullscreen()
Picture-in-Picture
player.store.state.pip
player.store.state.pipAvailability
player.store.state.requestPictureInPicture()
player.store.state.exitPictureInPicture()
player.store.state.togglePictureInPicture()
Remote Playback (AirPlay / Chromecast)
player.store.state.remotePlaybackState
player.store.state.remotePlaybackAvailability
player.store.state.toggleRemotePlayback()
Controls Visibility
player.store.state.userActive
player.store.state.controlsVisible
player.store.state.toggleControls()
Controls auto-hide after 2s of inactivity (on pointermove, keyup, focusin).
Error
player.store.state.error
player.store.state.dismissError()
Auto-reset on emptied (new source).
Text Tracks (Captions / Chapters / Thumbnails)
player.store.state.chaptersCues
player.store.state.thumbnailCues
player.store.state.thumbnailTrackSrc
player.store.state.textTrackList
player.store.state.subtitlesShowing
player.store.state.toggleSubtitles(forceShow?)
Live (live presets only)
player.store.state.liveEdgeStart
player.store.state.targetLiveWindow
Feature Presets
Not all state is available on every player build. Features depend on the preset:
| Preset | Features |
|---|
videoFeatures | playback, source, time, volume, playbackRate, buffer, fullscreen, pip, remotePlayback, controls, textTrack, error |
audioFeatures | playback, source, time, volume, playbackRate, buffer, error |
liveVideoFeatures | playback, source, time, volume, buffer, fullscreen, pip, remotePlayback, controls, textTrack, error, live |
liveAudioFeatures | playback, source, time, volume, buffer, error, live |
backgroundFeatures | (empty — no features, lightweight) |
The CDN video.js bundle uses videoFeatures.
Feed Unload/Reload Pattern
const player = document.querySelector('#feed video-player');
const video = player.querySelector('video');
video.removeAttribute('src');
video.load();
video.src = 'https://example.com/new-video.mp4';
video.load();
player.destroy();
player.remove();