Skip to content

Getting Your Videos Into Mux

Automatic Sync

The addon ships with a Mux Mirror fieldtype. When a field of this type is added to an asset container blueprint, videos uploaded to the container will be uploaded to Mux automatically. Videos deleted from the container will also be deleted from Mux. The handle of the field can be chosen freely.

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