Add a video player
Render a video and show its processing and quality status.
Use Frontbacked adaptive video for video file fields stored in posts. Theme authors keep video files as normal post fields, and Frontbacked gives the frontend a ready-to-use player API with adaptive quality, posters, timeline thumbnails, progress, and playlist controls.
Basic Player
Use f-video with a Frontbacked video file object:
f-video accepts either the file object stored in the post or a plain video URL. For Frontbacked video files, Frontbacked uses adaptive playback when the video is ready and falls back to MP4 when adaptive playback is unavailable.
Frontbacked automatically resizes generated posters and Frontbacked-owned custom posters to suit the player and screen density, using an optimized image format. Posters adapt when the player changes size or enters fullscreen. This works with both f-video and Frontbacked.video.attach(...); no theme-side resizing code is needed. External posters and poster URLs you have already resized are kept as supplied.
Replacing a Video with the Same File
When someone selects the same video again while editing a post, Frontbacked checks the file contents and the field's current video settings. If the existing result still fits those settings, it saves the edit without uploading or preparing the video again.
Saving other changes without selecting a replacement leaves the existing video unchanged. New duration, quality, size, or MIME rules apply when a file is replaced; changing the schema alone does not reprocess or remove a saved video.
If a changed duration or quality setting needs a different result, Frontbacked prepares a replacement from the original video already stored for that attachment. This also lets you restore a longer video or higher quality when you relax a previous limit. The current attachment stays available until the replacement is saved.
The current validation rules still apply: a video over a duration limit can be rejected, trimmed, or omitted according to videoDurationOverflow. If the original is no longer available, Frontbacked uploads the selected file again.
Processing Status
Video files are uploaded like any other file. When the file is read back, Frontbacked adds a read-only media object:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
media.status can be:
| Status | Meaning |
|---|---|
uploaded | The file has been received and is waiting for preparation. |
queued | The video is waiting to be processed. |
processing | Renditions, poster, fallback, and thumbnails are being prepared. |
ready | The video can be played. |
failed | The video could not be prepared. Check media.error. |
Use media.progress for progress toward first playback and upload.progress for upload progress. Once the lowest quality, poster, and timeline thumbnails are ready, media.status becomes ready and media.progress reaches 100. Visitors can watch immediately while higher qualities finish.
Quality Availability
Every video file field includes the quality information your theme needs:
| Field | Meaning |
|---|---|
media.qualityManifest | Current adaptive playlist, including every available quality. Use this for custom players that refresh as qualities finish. |
media.renditions | Qualities available for playback now. |
media.qualities | All planned qualities, with height, width, available, and status. |
media.processing.status | queued, processing, complete, or failed. |
media.processing.complete | true when every planned quality is ready. |
media.processing.error | A message when higher qualities could not be prepared. Available playback stays usable. |
For example, a video that is playable at 240p while higher qualities are being prepared exposes:
Reference excerpt: use this with the page, variables and functions described in this guide. Try a complete example →
A quality's status is queued, ready, or failed; check available before offering it for playback. Qualities depend on the source dimensions. The standard player only offers available qualities.
Use live post synchronization to receive updated file metadata as each quality becomes available. When the bound file updates, f-video refreshes the player's qualities while retaining the current playback position and whether the viewer has paused. With JavaScript, pass the updated file to Frontbacked.video.attach() again using the same element and options. To request the latest metadata directly, use await Frontbacked.video.status(file).
The local development server plays the original upload immediately. Its media.processing.complete is true, and media.qualities contains an available entry labeled Original. Hosted videos expose their generated quality heights.
When you only have the saved file identity, await Frontbacked.video.status(file) loads its current preparation status and media details. You can pass the saved file object or { mediaId }. This is useful for showing preparation progress after a form has saved.
Continue with Customize player controls.