playback adds paused and play(), volume adds volume and setVolume(), and so on.
Using features
Feature bundles and presets
You probably don’t want to hand-pick every feature your player needs. A feature bundle groups the features needed for a specific use case into a single array.- React
- HTML
videoFeatures bundles playback, volume, time, fullscreen, and more — everything a general video player needs:Create a player with individual features
If you’re not using presets, you can create a player with individual features:- React
- HTML
Extending a feature bundle
Feature bundles are just arrays of features, so extending one is straightforward. For example, if you’re using the/background preset and want a play button on your background video, add the playback feature:
- React
- HTML
Access features in components
- React
- HTML
Access feature state and actions through Each feature also has a pre-built selector (e.g.
usePlayer:selectPlayback, selectVolume) that returns just that feature’s state and actions:Feature availability
Volume, fullscreen, and picture-in-picture expose an*Availability property because platform support varies. For example, iOS Safari doesn’t allow programmatic volume control.
| Value | Meaning |
|---|---|
'available' | Ready to use |
'unavailable' | Could work, not ready yet |
'unsupported' | Platform can never do this |
PiPButton and FullscreenButton) expose a data-availability attribute, so you can hide unsupported controls with CSS:
- React
- HTML
Available features
playback
paused state and play() / pause() actions. The foundation of any player.volume
volume (0–1) and muted state, setVolume() and toggleMuted() actions. Includes volumeAvailability.time
currentTime and duration state, seek() action.fullscreen
fullscreen state and requestFullscreen() / exitFullscreen() actions. Includes fullscreenAvailability.pip
Picture-in-picture state and
requestPictureInPicture() / exitPictureInPicture() actions. Includes pipAvailability.textTrack
Subtitle, caption, chapter, and thumbnail track state.
toggleSubtitles() action.playbackRate
playbackRate state and setPlaybackRate() action.controls
Tracks user activity to show or hide controls.
source
Media source state for the current loaded source.
error
error state and dismissError() action for media errors.buffer
buffering state and buffer progress.