FeaturesImages & Media

Paste a URL, get the right player

The video field takes the link an author already has. Total CMS works out the provider, records the vendor's thumbnail and title, and renders a click-to-play embed from a single call.

Standard Included in Standard and Pro

An object in the video collection: a pasted YouTube URL detected as YouTube, with the vendor's thumbnail stored and labeled as the image in use.
An object in the video collection: a pasted YouTube URL detected as YouTube, with the vendor's thumbnail stored and labeled as the image in use.

The video field is for video hosted somewhere else. An author pastes the URL and optionally uploads a poster image; Total CMS never stores or serves the video bytes through this field, so there is no upload limit, no transcoding and no bandwidth liability.

What a pasted URL becomes

On save Total CMS resolves which provider the link belongs to, extracts the video id, records the vendor's own thumbnail and title, and works out the aspect ratio.

  • Recognised providers. Eight hosted ones: YouTube (including youtu.be links, Shorts and playlists), Vimeo, Livid, Bunny, Cloudflare Stream, Loom, Wistia and Publitio.
  • Direct files. A URL ending in .mp4, .webm, .mov, .m4v or .ogv renders as a native <video> element instead of an iframe.
  • Anything else. A generic iframe, with the URL exactly as pasted.
  • An allow-list. A providers setting on the field restricts which are accepted; a URL resolving outside it is rejected with a validation error.
  • Thumbnails only when needed. YouTube and Cloudflare thumbnails are derived from the URL with no network request. Other providers make one oEmbed call, only when the stored thumbnail is empty and the URL has actually changed. A failed fetch never blocks the save: the derived fields stay empty until the URL next changes, when it is retried.

Rendering the player

cms.render.video() takes the object, an options array, and an optional ImageWorks array applied to an uploaded poster.

  • A facade first. By default it renders the poster with a play button, and the iframe loads only on click. The first hover or touch preconnects to the player's hosts; the poster stays up until the iframe has loaded. On a page listing a dozen videos that is a dozen players' worth of weight not downloaded.
  • Options. facade: false gives an eager iframe; autoplay, loop, muted and controls are there when you need them.
  • A ready-made library. Setup Default Collections creates a video collection alongside image and file, one video per object, for a library you reference elsewhere. Both the collection and the property default to video, so an object from it renders by id alone.
  • Or your own. A video property on your own schema is reached with a property option, and works the same inside a card or deck item via a dotted path.

In practice

What it looks like in a template

twig
{# An object from the ready-made video collection #}
{{ cms.render.video('intro') }}

{# A video property on your own schema, poster resized through ImageWorks #}
{{ cms.render.video(post, {property: 'promo'}, {w: 1200, fm: 'webp'}) }}

One call renders the provider's player, using the uploaded poster when there is one and the vendor's thumbnail when there is not.

At a glance

What you get

Eight hosted providers
YouTube, Vimeo, Livid, Bunny, Cloudflare Stream, Loom, Wistia and Publitio, plus direct MP4 and WebM links rendered as a native video element.
Click-to-play by default
The poster renders with a play button and the iframe loads on click, so a page of a dozen videos does not download a dozen players.
Poster or vendor thumbnail
Upload a poster and it is served through ImageWorks; leave it empty and the provider's own thumbnail is used instead.
No bytes, no bandwidth
The field never accepts an upload. For video you host yourself, use a file field, which plays back with HTTP range support.
One call in a template
cms.render.video() renders the right player whether the value is a hosted URL, a direct media file, or a file field holding video.

Video

Common questions

Can I upload a video file?

Not through the video field, which never stores video bytes. Use a file field for video you host yourself — cms.render.video() renders that too, and playback supports HTTP range requests.

What happens if the provider's thumbnail fetch fails?

The object still saves. A failed fetch leaves the derived fields empty and is retried when the URL changes, not on every subsequent save of the same URL.

Can I restrict which providers authors may use?

Yes. The providers setting is an allow-list of provider ids, and a URL that resolves to a provider outside it is rejected with a validation error.

Does a video field work inside a deck or a card?

Yes. The stored shape is the same one level down, and it renders with a dotted property path such as hero.promo.

Try it on a site of your own.

45 days, every Pro feature, no credit card. Build it, hand it to a client, and see what they can and can’t touch.