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:
twig
{# 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 %}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.
twig
{% set muxAsset = craft.mux.one() %}
{# For usecured assets #}
{% if muxAsset.static_renditions|length %}
<a href="https://stream.mux.com/{{ muxAsset.playback_ids[0].id }}/{{ muxAsset.static_renditions.files[0].name }}?download={{ muxAsset.title }} download target="_blank">Download Video/Audio</a>
{% endif %}
{# For secured playback assets #}
{% if muxAsset.securePlayback %}
{% set videoToken = muxAsset.getSecurePlaybackJWT(keyID, 'v') %}
{% if muxAsset.static_renditions|length %}
<a href="https://stream.mux.com/{{ muxAsset.playback_ids[0].id }}/{{ muxAsset.static_renditions.files[0].name }}?download={{ muxAsset.title }}&token={{ videoToken }}" download target="_blank">Download Video/Audio</a>
{% endif %}
{% endif %}
{# For multiple static renditions #}
{% if muxAsset.static_renditions|length %}
{% for file in muxAsset.static_renditions.files %}
<a href="https://stream.mux.com/{{ muxAsset.playback_ids[0].id }}/{{ file.name }}?download={{ muxAsset.title }} download target="_blank">Download Video/Audio ({{ file.resolution }})</a>
{% endif %}Methods
getPlaybackId string
twig
{# Returns the first playback_id in the playback_ids property array #}
{% set muxAsset = craft.mux.one() %}
{% set playbackId = muxAsset.getPlaybackId() %}securePlayback boolean
twig
{% set muxAsset = craft.mux.one() %}
{% if muxAsset.securePlayback %}{% endif %}signedKeys array
twig
{% set muxAsset = craft.mux.one() %}
{% set signedKeys = muxAsset.signedKey %}getSecurePlaybackJWT(signedKey, mediaType, options) string
- signedKey: Mux Signed Key
- mediaType:
v = video, t = thumbnail, g = gif, s = storyboard - options:
["time" => 10, "width" => 640, "fit_mode" => "smartcrop"]
twig
{% set muxAsset = craft.mux.one() %}
{% set signedKeys = muxAsset.getSecurePlaybackJWT(signedKey, mediaType, options) %}