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.
| Feature | How it works |
|---|---|
| Fullscreen | Button or f, including iOS native-fullscreen quirks |
| Picture-in-Picture | Button appears where the browser supports it; stays in sync with the browser's floating window, so closing that window fires pipchange too |
| Playback rate | Cycles 0.5-2, firing ratechange. setPlaybackRate(rate) for any value |
| Loop | Toggle in the controls popup; fires loopchange once playback has started |
| Buffering | Debounced spinner once playback stalls; bufferstart/bufferend for rebuffer count and ratio |
| Live streams | TimeDisplay shows a "Live" badge and seeking is hidden |
| Position memory | Persists and restores playback position across mounts - never for live streams |
| Keyboard shortcuts | Space/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 offscreen | Always on: playback pauses once the player drops below 10% visible, unless pin sends it to a corner instead |
| Native UI | nativeUi hands control to YouTube/Vimeo/Dailymotion's own player chrome instead of the built-in HUD |
| Error recovery | An 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.