Video Player API
View componentThe full prop reference for the Video Player component. A fully-featured HTML5 video player with playlists, chapter markers, SRT/VTT subtitles, video filters, quality levels, and HLS adaptive streaming.
Import
import { VideoPlayer } from '@structyl/styled';Props
VideoPlayer
A feature-rich video player component supporting multiple video sources, playlists, subtitles, chapters, quality selection, filters, and keyboard controls. Supports MP4/WebM, YouTube URLs, and HLS streams.
| Prop | Type | Default |
|---|---|---|
| src# | stringThe video source URL (MP4, WebM, YouTube URL, or HLS .m3u8 stream) | — |
| poster# | string | undefinedPoster/thumbnail image URL displayed before playback starts | — |
| autoPlay# | booleanWhether the video should start playing automatically | false |
| loop# | booleanWhether the video should loop when it reaches the end | false |
| muted# | booleanWhether the audio is muted by default | false |
| className# | stringCustom CSS classes applied to the container div | '' |
| subtitles# | SubtitleTrack[]Array of subtitle tracks to load ({ label, language, src, kind? }) | [] |
| playlist# | PlaylistItem[]Array of playlist items for multi-video playback ({ id, title, src, poster?, duration? }) | [] |
| chapters# | Chapter[]Array of chapter markers ({ id, title, startTime, endTime }) | [] |
| onPlay# | (() => void) | undefinedCallback fired when playback starts | — |
| onPause# | (() => void) | undefinedCallback fired when playback pauses | — |
| onEnded# | (() => void) | undefinedCallback fired when the video ends | — |
| onTimeUpdate# | ((currentTime: number) => void) | undefinedCallback fired on each time update, providing the current playback time in seconds | — |
| onVolumeChange# | ((volume: number) => void) | undefinedCallback fired when volume changes, providing the new volume (0-1) | — |
Keyboard interactions
| Key | Description |
|---|---|
| Space / K | Toggle play/pause. |
| → | Skip forward 10 seconds. |
| ← | Skip backward 10 seconds. |
| ↑ | Increase volume by 10%. |
| ↓ | Decrease volume by 10%. |
| M | Toggle mute. |
| F | Toggle fullscreen. |
| P | Toggle Picture-in-Picture. |
| C | Toggle subtitles. |
| . | Advance one frame (1/30 s). |
| , | Go back one frame (1/30 s). |
Source code
If you didn't find what you need here, read the component implementation .