API Reference
Props
Every VideoCard / VideoPlayer prop, with types and defaults.
Accepted by VideoCard and VideoPlayer, and by each entry in VideoStage's playlist.
Source & presentation
| Prop | Type | Default | Description |
|---|---|---|---|
src | string | - | Required. Video URL or platform URI - the platform is auto-detected |
label | string | '' | Video label, shown on the placeholder and used as the accessible name |
poster | string | '' | Poster image URL |
aspectRatio | string | '16:9' | e.g. '16:9', '9:16', '4:3' |
tracks | CaptionTrackDef[] | - | WebVTT tracks: { src, kind?, srclang?, label?, default? } - native path only, see captions |
payload | object | string | {} | Arbitrary data attached to every state-change event. A JSON string is accepted too, since a custom-element attribute arrives as one |
captionLine | number | - | Pins rendered cues to this line on the native caption layer - use it to lift captions clear of your own HUD. Native sources only |
Playback
| Prop | Type | Default | Description |
|---|---|---|---|
autoplay | boolean | false | Autoplay on mount - always starts muted, since browsers block unmuted gesture-less playback |
muted | boolean | - | Force a starting mute state; unset follows the shared audio preference |
volume | number | - | Force a starting volume (0-1); unset follows the shared preference |
playbackRate | number | 1 | Initial playback rate |
quality | number | null | - | A target height in pixels (the 720 in 720p); the nearest level the source offers is selected once its levels are known. null forces Auto; unset restores the height the viewer last picked on another video, or leaves Auto if they never picked one. One-way: a level the viewer picks stands until the prop changes. See quality |
loop | boolean | false | Start with looping on. Reactive - flipping it later is the same as calling toggleLoop() |
preload | 'none' | 'metadata' | 'auto' | - | The native <video preload> attribute; unset leaves the browser default. 'none' defers loading for MP4 and HLS alike (hls.js is held back until the first play), but not for DASH. 'metadata'/'auto' leave HLS loading as normal, since hls.js buffers ahead regardless of the attribute. Embed platforms ignore it |
lazy | boolean | true | VideoCard only: show a placeholder until clicked |
playInView | boolean | false | Auto-play once at least half visible (or playInViewRatio), and again each time it scrolls back in, unless the viewer paused it or it ended. Implies muted unless muted is set. Works with the lazy placeholder. (Auto-pause below 10% visible is always on, playInView or not) |
playInViewRatio | number | 0.5 | How much of a playInView player (above 0, up to 1) must be on screen before it plays. 1 waits for all of it; a player too big to fit plays once it fills as much of the screen as it can |
pin | PinCorner | - | Once scrolled out of view while playing, pin to that corner instead of auto-pausing: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left' |
autoStage | boolean | false | VideoCard only: send this video to the VideoStage on mount |
deepLink | boolean | string | false | Answer a page URL that points at a moment (#ml-t=42,52): scroll into view, seek to the start, highlight the range. A string is this player's id, for links with &ml-player=<id>. See deep links |
deepLinkEnd | 'pause' | 'loop' | 'continue' | 'pause' | What happens at the end of a deep-linked range |
UI
| Prop | Type | Default | Description |
|---|---|---|---|
controls | boolean | true | false renders a bare <video> with no HUD - drive it via methods or headless controls. setControls() on the handle overrides it for a while |
nativeUi | boolean | false | Use the platform's own controls (YouTube, Vimeo, Dailymotion only) |
action | PlayerAction | null | Extra HUD button - a built-in ('mute' | 'loop' | 'autoplay') or { icon, label, onClick } |
disableTapCapture | boolean | false | Disables the full-video tap-to-reveal-controls overlay |
disableKeyboardShortcuts | boolean | false | Disables the Space/k/arrows/m/f/c/0-9/Home/End hotkeys while the player has focus |
Ads
| Prop | Type | Default | Description |
|---|---|---|---|
adTagUrl | string | '' | VAST or VMAP ad tag URL |
adMacroParams | Record<string, string> | - | Fills {macro} tokens in whichever ad tag ends up in use, including an auto-discovered one |
headerBidding | HeaderBiddingConfig | - | { adUnit, params?, timeoutMs? } - runs a Prebid.js auction before the ad, see header bidding |
If several
playInView players are visible at once, a shared debounce lets only the last one to cross the threshold play.