Mux Element Properties
This documentation covers all available element properties. View MUX documentation asset properties.
Complete Variable Reference
Query-Only Variables (for filtering assets)
These variables can only be used in queries to filter MuxAsset elements, not accessed as properties on individual assets.
Basic Asset Properties
asset_id- Filter by Mux asset IDasset_status- Filter by processing statusaspect_ratio- Filter by aspect ratioduration- Filter by duration in secondsis_live- Filter by live stream status
Upload and Processing Properties
upload_id- Filter by upload IDcreated_at- Filter by creation dateingest_type- Filter by ingest type
Playback and Rendition Properties
playback_ids- Filter by playback IDsmp4_support- Filter by MP4 support status Depreciatedstatic_renditions- Filter by static renditions
Quality and Resolution Properties
max_stored_resolution- Filter by maximum stored resolutionmax_stored_frame_rate- Filter by maximum stored frame rateresolution_tier- Filter by resolution tiermax_resolution_tier- Filter by maximum resolution tier
Custom Data Properties
passthrough- Filter by passthrough datameta- Filter by metadataerrors- Filter by error status
Track Properties (Query-Only)
trackType- Filter by track typetrackMaxWidth- Filter by track maximum widthtrackMaxHeight- Filter by track maximum heighttrackMaxFrameRate- Filter by track maximum frame ratetrackDuration- Filter by track durationtrackPrimary- Filter by primary track statustrackMaxChannels- Filter by track maximum channelstrackTextType- Filter by text track typetrackTextSource- Filter by text track sourcetrackStatus- Filter by track statustrackName- Filter by track nametrackLanguageCode- Filter by track language codetrackId- Filter by track ID
Metadata Properties (Query-Only)
metaTitle- Filter by metadata titlemetaExternalId- Filter by metadata external IDmetaCreatorId- Filter by metadata creator ID
Folder and Volume Properties
folderId- Filter by folder IDincludeSubfolders- Include assets from subfoldersfolderPath- Filter by folder pathvolumeId- Filter by volume ID
Standard Element Query Methods
id- Filter by element IDoffset- Offset resultslimit- Limit number of resultsorderBy- Order results
Example Usage:
{# Access basic properties #}
{{ asset.assetId }}
{{ asset.duration }}
{{ asset.aspectRatio }}
{{ asset.isLive }}
{# Access track information #}
{% for track in asset.tracks %}
{{ track.type }} - {{ track.name }}
{% endfor %}
{# Access playback id #}
{{ asset.playback_ids[0].id }}
{# Access metadata #}
{{ asset.meta.title }}
{{ asset.meta.creatorId }}
{# Check if asset is ready #}
{% if asset.assetStatus == 'ready' %}
{# Asset is ready for playback #}
{% endif %}
{# Audio-only (tracks present, no video track) #}
{% if asset.isAudioOnly %}
{# Skip video-only UI (thumbnails, aspect ratio, video renditions) #}
{% endif %}Static Renditions
"Highest" is mutually exclusive with specific resolutions. To switch types (e.g. Highest to 1080p), first uncheck and save to delete, then select the new resolution and save again. Note static renditions will not upscale.
getStaticRenditionUrl() builds the download URL for public and signed assets (it adds the token for signed ones), so you don't need separate templates.
{% set muxAsset = craft.mux.one() %}
{# First rendition #}
{% set file = muxAsset.static_renditions.files[0] ?? null %}
{% if file %}
<a href="{{ muxAsset.getStaticRenditionUrl(file.name, muxAsset.title ~ '.' ~ file.ext) }}" download>Download Video/Audio</a>
{% endif %}
{# Every rendition #}
{% for file in muxAsset.static_renditions.files ?? [] %}
<a href="{{ muxAsset.getStaticRenditionUrl(file.name, muxAsset.title ~ '.' ~ file.ext) }}" download>Download ({{ file.resolution ?? file.name }})</a>
{% endfor %}The second argument is the file name the browser saves the download as. Leave it out to play the file in the browser instead.
Methods
hasVideoTrack() boolean
Returns true when tracks contains a track with type video.
{% if muxAsset.hasVideoTrack() %}
{# Video (or muxed) asset #}
{% endif %}isAudioOnly boolean
Derived: tracks are present and none have type video. Also available as getIsAudioOnly(). Exposed in GraphQL as isAudioOnly.
{% if muxAsset.isAudioOnly %}
{# Audio file — no video thumbnail or aspect ratio #}
{% endif %}getPlaybackId(policy) string|null
Returns the first playback ID, or null while the asset is still processing or if it errored. Pass 'public' or 'signed' to get the first playback ID with that policy, for assets that have both.
{% set muxAsset = craft.mux.one() %}
{% set playbackId = muxAsset.getPlaybackId() %}
{% if playbackId %}
{# getPlaybackToken() is null for public videos, so this works for both #}
{% set token = muxAsset.getPlaybackToken('v') %}
<mux-player
playback-id="{{ playbackId }}"
{% if token %}playback-token="{{ token }}"{% endif %}
></mux-player>
{% endif %}
{% set signedId = muxAsset.getPlaybackId('signed') %}
{% set publicId = muxAsset.getPlaybackId('public') %}getPlaybackIdData(policy) array|null
Like getPlaybackId(), but returns the whole entry: {id: '…', policy: 'public'|'signed'}.
securePlayback boolean
true when the asset's first playback ID is signed.
{% set muxAsset = craft.mux.one() %}
{% if muxAsset.securePlayback %}{% endif %}Signed Playback Methods
These methods work for public and signed playback IDs. For a signed ID they add a token; for a public ID they return a plain URL (and tokens are null). See Signed Playback for how tokens, modifiers and lifetimes work.
All of them take these optional trailing arguments:
| Argument | Default | Description |
|---|---|---|
expiresIn | signedTokenLifetime (24 hours) | Minimum token lifetime in seconds, capped at maxSignedTokenLifetime. Ignored for public IDs. |
policy | first playback ID | 'public' or 'signed', to choose a playback ID when the asset has both |
They return null when the asset has no playback ID yet, or when the playback ID is signed and no signing key exists.
hasSigningKey() boolean
true when a key exists under Mux → Signed Keys, so tokens can be created.
{% if muxAsset.securePlayback and not muxAsset.hasSigningKey() %}
{# Signed video that can't be played yet #}
{% endif %}getPlaybackToken(type, modifiers, expiresIn, policy, keyId) string|null
Returns a token (JWT) for <mux-player> or for building URLs yourself. Returns null for a public playback ID.
| Argument | Default | Description |
|---|---|---|
type | 'v' | v video (stream, captions, downloads), t thumbnail, g gif, s storyboard |
modifiers | {} | Modifiers for that type, e.g. {time: 2, width: 1280}, plus an optional playback_restriction_id |
expiresIn | 24 hours | See above |
policy | first playback ID | See above |
keyId | oldest signing key | A specific key from Mux → Signed Keys |
<mux-player
playback-id="{{ muxAsset.getPlaybackId() }}"
playback-token="{{ muxAsset.getPlaybackToken('v') }}"
thumbnail-token="{{ muxAsset.getPlaybackToken('t', {time: 2}) }}"
storyboard-token="{{ muxAsset.getPlaybackToken('s') }}"
></mux-player>getStreamUrl(modifiers, expiresIn, policy) string|null
HLS URL: https://stream.mux.com/{id}.m3u8. Modifiers: max_resolution, min_resolution, rendition_order, redundant_streams, roku_trick_play, default_subtitles_lang, asset_start_time, asset_end_time, program_start_time, program_end_time.
{# For a custom HLS player (hls.js, Video.js) or Safari's native <video> #}
{% set src = muxAsset.getStreamUrl({max_resolution: '720p'}) %}getThumbnailUrl(modifiers, format, expiresIn, policy) string|null
Still image: https://image.mux.com/{id}/thumbnail.{format}. format is webp (default), jpg or png. Modifiers: time, width, height, fit_mode, rotate, flip_v, flip_h.
<img src="{{ muxAsset.getThumbnailUrl({width: 640, height: 360, fit_mode: 'smartcrop', time: 2}, 'jpg') }}" alt="">thumb(width, height, fit_mode, format) string|null
Shortcut for getThumbnailUrl(). Defaults: 300, 169, 'smartcrop', 'webp'.
<img src="{{ muxAsset.thumb(640, 360) }}" alt="">getAnimatedUrl(modifiers, format, expiresIn, policy) string|null
Animated preview: https://image.mux.com/{id}/animated.{format}. format is gif (default) or webp. Modifiers: start, end (max 10 seconds long), width, height (max 640), fps (max 30).
<img src="{{ muxAsset.getAnimatedUrl({width: 320, start: 0, end: 4, fps: 12}) }}" alt="">getStoryboardUrl(format, expiresIn, policy) string|null
Timeline storyboard: https://image.mux.com/{id}/storyboard.{format}. format is vtt (default), json, jpg, png or webp.
{{ muxAsset.getStoryboardUrl() }}getTextTrackUrl(trackId, expiresIn, policy) string|null
Captions/subtitles (WebVTT): https://stream.mux.com/{id}/text/{trackId}.vtt.
{% for track in muxAsset.tracks|filter(t => t.type == 'text') %}
<a href="{{ muxAsset.getTextTrackUrl(track.id) }}">{{ track.name }} captions</a>
{% endfor %}getStaticRenditionUrl(name, download, expiresIn, policy) string|null
MP4/M4A file: https://stream.mux.com/{id}/{name}, e.g. highest.mp4, 1080p.mp4, audio.m4a. download is an optional file name that makes the browser download the file.
<a href="{{ muxAsset.getStaticRenditionUrl('highest.mp4', 'my-video.mp4') }}">Download</a>getSecurePlaybackJWT(keyId, mediaType, options, expiresIn) string|null
The original token method, kept for existing templates. Returns a token for the first playback ID when it's signed, otherwise null.
keyId: signing key ID. Optional from 2.8.0; defaults to the oldest key.mediaType:vvideo,tthumbnail,ggif,sstoryboardoptions: modifiers, e.g.{time: 10, width: 640, fit_mode: 'smartcrop'}. Before 2.8.0, these were silently dropped.expiresIn: minimum lifetime in seconds
{% set token = muxAsset.getSecurePlaybackJWT(null, 't', {time: 10, width: 640}) %}For new templates, getPlaybackToken() is equivalent and can also choose a playback ID by policy.
signedKeys / securePlaybackTokens Deprecated
Return the stored signing key records, including private keys. Don't output them in a page. Use hasSigningKey() to check whether signing is possible; the methods above pick the key for you.