VideoPlayer
A styled, reusable video player: an object-contain
video on a black stage with the on-theme VideoControls (auto-hiding
while playing). Used on its own (e.g. clip preview) so a plain video matches
the player's look instead of the unstyled native controls, and composed by
the player feature, which layers its subtitle overlay on top via overlay.
Interfaces¶
VideoPlayerOverlayContext¶
Defined in: src/shared/components/VideoPlayer.tsx:25
Context passed to a VideoPlayerProps.overlay render function.
Properties¶
| Property | Type | Description | Defined in |
|---|---|---|---|
controlsShown |
boolean |
Whether the control bar is currently shown (overlays lift above it). | src/shared/components/VideoPlayer.tsx:27 |
VideoPlayerProps¶
Defined in: src/shared/components/VideoPlayer.tsx:30
Properties¶
| Property | Type | Description | Defined in |
|---|---|---|---|
className? |
string |
Container (sizing) classes; defaults to a 16:9 box. | src/shared/components/VideoPlayer.tsx:33 |
crossOrigin? |
"" | "anonymous" | "use-credentials" |
crossOrigin for the <video> (needed to record cross-origin media). |
src/shared/components/VideoPlayer.tsx:37 |
id? |
string |
id for the <video> (the player uses it to record clips). |
src/shared/components/VideoPlayer.tsx:35 |
keyboardControls? |
boolean |
Toggle play/pause on the spacebar (for the primary, on-page player). | src/shared/components/VideoPlayer.tsx:41 |
onVideoEl? |
(el) => void |
Receives the <video> element as it mounts / unmounts. |
src/shared/components/VideoPlayer.tsx:39 |
overlay? |
(ctx) => ReactNode |
Renders an overlay above the video (e.g. subtitles). | src/shared/components/VideoPlayer.tsx:50 |
src |
string | null | undefined |
- | src/shared/components/VideoPlayer.tsx:31 |
tapToSeek? |
boolean |
Skip 5s by double-tapping the left / right edge of the video. Off by default so a small embedded preview (a clip) keeps a plain click-to-toggle with no tap-detection delay. | src/shared/components/VideoPlayer.tsx:48 |
Functions¶
VideoPlayer()¶
Defined in: src/shared/components/VideoPlayer.tsx:59
The VideoPlayer component.
Parameters¶
| Parameter | Type | Description |
|---|---|---|
props |
VideoPlayerProps |
The player props. |
Returns¶
Element
The styled video player.