Skip to content

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 ​

Upload and Processing Properties ​

Playback and Rendition Properties ​

Quality and Resolution Properties ​

Custom Data Properties ​

Track Properties (Query-Only) ​

Metadata Properties (Query-Only) ​

Folder and Volume Properties ​

Standard Element Query Methods ​

  • id - Filter by element ID
  • offset - Offset results
  • limit - Limit number of results
  • orderBy - 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 %}

{# 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.

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 ​

hasVideoTrack() boolean ​

Returns true when tracks contains a track with type video.

twig
{% 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.

twig
{% if muxAsset.isAudioOnly %}
    {# Audio file — no video thumbnail or aspect ratio #}
{% endif %}

getPlaybackId string|null ​

twig
{# First playback_id, or null if playback_ids is empty (still processing / errored) #}
{% set muxAsset = craft.mux.one() %}
{% set playbackId = muxAsset.getPlaybackId() %}
{% if playbackId %}
    <mux-player playback-id="{{ playbackId }}"></mux-player>
{% endif %}

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) %}