API Reference

Built-in behaviour

What the player does out of the box - fullscreen, PiP, rate and loop, buffering, live streams, position memory, keyboard shortcuts.

Each is surfaced through the built-in HUD, and most are also reachable from the template-ref API if you're building your own.

FeatureHow it works
FullscreenButton or f, including iOS native-fullscreen quirks
Picture-in-PictureButton appears where the browser supports it; stays in sync with the browser's floating window, so closing that window fires pipchange too
Playback rateCycles 0.5-2, firing ratechange. setPlaybackRate(rate) for any value
LoopToggle in the controls popup; fires loopchange once playback has started
BufferingDebounced spinner once playback stalls; bufferstart/bufferend for rebuffer count and ratio
Live streamsTimeDisplay shows a "Live" badge and seeking is hidden
Position memoryPersists and restores playback position across mounts - never for live streams
Keyboard shortcutsSpace/k play-pause · arrows seek/volume · m mute · f fullscreen · c captions · 0-9 percent-jump · Home/End. Scoped per player, never fire while typing in a text field, and disabled entirely by disableKeyboardShortcuts
Auto-pause offscreenAlways on: playback pauses once the player drops below 10% visible, unless pin sends it to a corner instead
Native UInativeUi hands control to YouTube/Vimeo/Dailymotion's own player chrome instead of the built-in HUD
Error recoveryAn error shows a Retry button; retry() does the same programmatically

The controls popup opens on "show controls" and stays until dismissed by a click outside it. Fullscreen works the other way and has no dismissal: the popup auto-shows on activity and hides after inactivity, the way a fullscreen player is expected to, and always docks to the bottom regardless of --ml-video-popup-align, leaving the big play button centred above it.

munsonlabs · MIT licensed · © 2026