On this page
Video reference
Attach and control a video player.
Method signatures
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Before you begin: Images reference.
Video Helpers
Use f-video for Frontbacked-owned video file fields:
Frontbacked.video.attach(videoElement, source, options?) attaches the same adaptive playback behavior from JavaScript and returns a player instance.
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
Player methods:
| Method | Purpose |
|---|---|
play(), pause(), toggle() | Control playback. |
seekTo(seconds), seekBy(seconds) | Move playback to an absolute or relative time. |
currentTime(), duration(), remaining() | Read playback time values. |
mute(), unmute(), setMuted(value), setVolume(value) | Control audio state. |
setQuality(value) | Set a quality such as "auto" or a rendition height. |
setLayout(value) | Switch player layout, such as standard or portrait. |
appendVideo(source), next(), prev(), list() | Build and control a playlist. |
destroy() | Remove Frontbacked player behavior from the element. |
Frontbacked.video.source(source) normalizes a video source into the shape attach(...) uses. Use it when custom player UI needs to inspect poster, fallback, thumbnails, or prepared playback data before attaching.
Frontbacked.video.environment(videoElement) returns the current playback environment Frontbacked uses when choosing an initial quality. It is helpful for custom quality UIs and local testing.
Frontbacked.video.setSimulation(profile), .clearSimulation(), .playSimulation(sequence, element?), and .stopSimulationSequence() are local testing helpers for previewing quality selection and playback callbacks.
Video file objects include media metadata on reads. Check video.media.status for uploaded, queued, processing, ready, or failed. Use the Adaptive Video guide for player options, quality selection, timeline thumbnails, playlists, append behavior, previous-video loading, and callbacks.
Continue with Uploads and posts reference.