Skip to content
transom.design

Multiple formats

Configure a field with two presets (e.g. web-vp9-1080p and web-h264-1080p) for broad browser coverage. List the preferred format first — the browser picks the first <source> it supports.

Both variants share the same poster, pulled from whichever variant is queried first:

{% set vp9 = entry.video.variant('web-vp9-1080p') %}
{% set h264 = entry.video.variant('web-h264-1080p') %}
<video controls poster="{{ (vp9 ?? h264).thumbnailUrl }}">
{% if vp9 %}<source src="{{ vp9.url }}" type="{{ vp9.mimeType }}">{% endif %}
{% if h264 %}<source src="{{ h264.url }}" type="{{ h264.mimeType }}">{% endif %}
</video>
FormatSupport
H.264Universal — every browser
VP9 / WebMSafari 16+ (Sep 2022), all others
AV1Safari 17+ (Sep 2023, hardware only on older chips), all others

VP9 is the recommended primary format for new projects. H.264 is the safe fallback for audiences that may include Safari 15 or older.