[PLUGIN] - VideoJS Advanced + YouTube, Vimeo, Wistia, HLS, DASH, MUX, Pre-roll Ads (plus more)

MUX Update

New actions and API endpoints have been added to support the upload of assets into a MUX environment. For anyone interested in this and for the purpose of documentation, details are below.


NEW STATES

  • MUX upload progress
    Shows the file upload progress value when uploading a media file to MUX.
    The value can be used with a progress bar.

  • MUX upload error
    Shows the error message of a MUX upload.

  • MUX upload attempt failure
    Shows the attempt failure message of a MUX upload.

  • MUX upload completed
    Shows true when a MUX upload has completed.

  • MUX selected file size
    Shows the file size for a selected file (in bytes) to be uploaded to MUX.

  • MUX selected file name
    Shows the file name for a selected video file to be uploaded to MUX.

  • MUX selected file duration
    Shows the duration (in seconds) for a selected video file to be uploaded to MUX.

  • MUX selected file poster
    Shows the poster for a selected video file to be uploaded to MUX.

  • MUX upload paused
    Shows Yes when the upload process to a MUX account has been paused.


NEW EVENTS

  • MUX upload has errored
    Fired when a MUX upload has errored.

  • MUX upload has completed
    Fired when a MUX upload has completed.

  • Fired when a MUX upload has completed.
    Fired when a MUX upload has started.


NEW ACTIONS

  • Upload media to MUX
    This action uploads a media file to MUX.
    -Endpoint URL
    This needs to be the result of running the "Create upload URL (MUX)" endpoint. You need the URL in this field.
    -Chunk size
    This is the chunk size (in bytes) which determines how much data to upload (in chunks) which is better suited for handling large media files. The default is 10mb.

Splits the file into chunks that are a multiple of 256KB (256 1024 bytes). For example, if you wanted to have 20MB chunks, you’d want each one to be 20,971,520 bytes (20 1024 * 1024). The exception is the final chunk, which can just be the remainder of the file. Bigger chunks will be a faster upload, but think about each one as its own upload in the sense of needing to restart that one if it fails, but needing to upload fewer chunks can be faster.

  • Pause MUX upload
    Pauses the upload process to MUX.

  • Resume MUX upload
    Resumes the upload process to MUX if paused.


NEW DATA CELLS - (API endpoints)

These requests require Basic authorization to connect. To generate the correct base64 authorization key, you’ll need your Token ID and Token Secret which you get through MUX, and then you will probably need to follow this…

http://paul-testing-4.bubbleapps.io/base64_authorization

  • Create upload URL (MUX)
    Creates an authenticated MUX URL which is required before uploading any video files, or more specifically before running the new upload action above since you need to supply the endpoint URL.
    Create Direct Upload reference | Mux

  • Check asset status (MUX)
    Returns various information on assets. Typically used to return playback ID's, duration and other information. Requires an asset ID
    Get Asset reference | Mux

  • Check upload URL (MUX)
    Can be used to check the progress of the create upload URL. Most of the time you won't need this as a new URL is created straight away. This requires the ID in the response from running the upload URL above.
    Get Direct Upload reference | Mux


Note 1: There is an API request for uploading files which isn’t included at the moment. The reason for creating an Action to do this was because it handles large media files in a better way. If the connection goes offline for a period of time, the upload will not stop, instead it will pause and then resume when the connection comes online again. Attempting to upload potentially large media files through their API request is doable but if it fails the process needs to restart.

Note 2: For anyone interested in generating thumbnails, it’s an area being worked on now. There is now a new action called “Generating thumbnails” which does everything that my original CodePen does. It’s being worked on at the moment to improve it but it is included.

Demo: Paul-testing-4 | Bubble Editor

Paul

1 Like