Mux EE Module Docs

for ExpressionEngine

Import & Syncing

Demo of using DataGrab to import videos into new entries.

There are several ways to get video into ExpressionEngine and Mux during initial migrations or if things get out of sync.

Import for Migration or Intervals into Entry Fields

The Mux Asset field saves Mux IDs. The field is simply an input that holds a pipe-separated list of Mux IDs. Simply pass a string of what the values should be and save. In addition the field will look for URLs to videos and import them (more on this below). This is ideal for that initial migration from another system or at intervals. DataGrab and Smart Import are perfect for handling the ingestion and mapping to fields.

Input Field:

XXXXXX|XXXXX|XXXXX

A CSV may look something like this:

Title Field Description Field Mux Asset Field
My First Video Super cool description ABCDEFGHIJK|ABCDEFGHIJK
My Second Video Another description ABCDEFGHIJK
My Third Video Yet another description https://example.com/myvideo.mp4

Simply map the Mux Asset Field column to the actual column in ExpressionEngine in your import process. The existing Mux IDs in the first two rows will be attached to the new entries. The third that contains a URL will be uploaded to Mux, and an ID will be saved in its place.

URLs:

URLs can be used to import into Mux and EE. This is ideal for importing from other video providers or cloud storage where JSON or CSV export of entries and URLs can be created and imported into ExpressionEngine. Each video link will be imported into Mux as a new asset, and the new Mux ID will be added to the field. Simply create a column (csv) or property string (json) to store all the video URLs for a field and match it to the EE Asset field.

Input Field:

http://example.com/video1.mp4|http://example.com/video2.mp4|http://example.com/video3.mp4

Video imports are non-blocking, meaning that the transfer/upload process to Mux will not block the php script from running. The video will show as preparing, and Mux will push a webhook to update EE when the video is ready. Note that URLs must be accessible by your EE install and Mux.

Live

Input Field:

Input Field: XXXXXXXX

The live stream field contains one ID. If you already have an ID, simply add it like a normal text field either programmatically through the data importers when migrating data, or manually by copy-paste!

Live stream IDs are created when an entry is update or created based on conditions being met. Either on first-time imports or reoccurring imports from another system. This means if you have an event booking system that imports into EE on a regular schedule, a live stream can automatically be created and saved to the entries created.

To work correctly, the IDs saved in the field must also be in the EE database. IDs reference additional Mux data saved locally when videos are created, and updated via webhooks. Use the Sync tool for missing video data.

Sync from Mux

Included is a sync tool that will grab all the assets on Mux and see which are missing from the EE database. Missing videos can then be added to the database. Deleted videos are skipped. Useful for if you change environments, have migrations, or had a number of missing webhook deliveries.