Skip to content
transom.design

Reference

A Video Scribe field returns a VideoScribeValue object with the following properties and methods.

Property / methodReturnsDescription
video.hasVariantsboolWhether any transcoded variants exist
video.variantsVariantRecord[]All saved variants (silently drops any with missing assets or deleted presets)
video.variant(handle)VariantRecord|nullA specific variant by preset handle
video.sourceAsset|nullThe original source file, if Keep source was enabled

Each item in video.variants (and the return of video.variant(handle)) is a VariantRecord:

PropertyTypeDescription
variant.urlstring|nullCDN/volume URL of the video file
variant.mimeTypestringe.g. video/webm; codecs="vp9"
variant.thumbnailUrlstring|nullURL of the poster JPEG
variant.thumbnailAsset|nullPoster as a Craft Asset (supports image transforms)
variant.widthint|nullPixel width
variant.heightint|nullPixel height
variant.durationfloat|nullDuration in seconds
variant.sizeint|nullFile size in bytes
variant.assetAsset|nullThe video Craft Asset element
{% set video = entry.heroVideo %}
{% if video and video.hasVariants %}
{% set v = video.variants | first %}
{# {{ v.width }}×{{ v.height }}, {{ v.duration }}s, {{ v.size / 1024 / 1024 | round(1) }} MB #}
<video
poster="{{ v.thumbnailUrl }}"
width="{{ v.width }}"
height="{{ v.height }}"
muted autoplay loop playsinline
>
{% for variant in video.variants %}
<source src="{{ variant.url }}" type="{{ variant.mimeType }}">
{% endfor %}
</video>
{% endif %}