Skip to content

Getting Your Videos Into Mux

Automatic Sync

The addon ships with a custom Mux Mirror fieldtype. Add a field of this type to any asset container blueprint you plan on uploading videos from. The title and handle of the field don't matter and can be chosen freely.

Whenever a new video is uploaded to a container with this field in its blueprint, it will be mirrored to Mux. Any videos deleted from this container will also be deleted from Mux.

yaml
title: Asset
tabs:
  main:
    display: Main
    sections:
      -
        fields:
          -
            handle: alt
            field:
              display: 'Alt text'
              type: text
          - 
            handle: mux
            field: 
              type: mux_mirror
              display: Mux
              if: 
                extension: mp4

When editing the asset in the control panel, the Mux Mirror field will display the upload status of the asset, e.g. "Video uploaded to Mux". If you'd rather hide the field from editors, you can set its visibility to hidden.

Uploading Existing Videos

Adding a Mux Mirror field will enable automatic sync for videos uploaded from that point onwards. To sync existing videos that were uploaded before the field was added, you'll need to manually run one of the available Artisan Commands, e.g.:

sh
# Upload existing videos to Mux
php please mux:upload

Video Metadata

Mux videos support a set of metadata fields that are set when uploading video files. The addon will pull these from the asset blueprint if possible. You can customize metadata using a hook.

MetaValueExample
titleValue of asset's title field
(or filename if empty)
Good Times or video.mp4
creator_idAddon namestatamic-mux
external_idAsset idassets::video.mp4

Unlicensed commercial plugin