A plugin for uploading video and audio files to Mux and managing them within Strapi.
A Strapi plugin for managing uploads to Mux.
This plugin provides the ability to upload content via a url or a direct file upload to Mux.
.vtt
or .srt
files) or Mux's auto-generated captionsFor installing with Strapi v5, install the latest—
npm i strapi-plugin-mux-video-uploader@latest
yarn add strapi-plugin-mux-video-uploader@latest
For installing with Strapi v4, install v2.0.0—
npm i strapi-plugin-mux-video-uploader@2.8.4
yarn add strapi-plugin-mux-video-uploader@2.8.4
In order for this plugin to communicate with Mux, some configuration values need to be set for the plugin before it can be used.
Starting in v3.0.0 of this plugin, we have switch to Strapi's File Based Config. To increase the portability of clustered deployments, we have switched to this paradigm to manage app configs. This means that setting the configurations using the Settings view in the Strapi Admin UI will no longer be available.
In migrating to v3.0.0, you will need to transition to the Strapi File Based Config and copy the values that you had used to initially set up your plugin—
1// Path: ./config/plugins.ts
2export default ({env}) => ({
3 // ...
4 "mux-video-uploader": {
5 enabled: true,
6 config: {
7 accessTokenId: env('ACCESS_TOKEN_ID'),
8 secretKey: env('ACCESS_TOKEN_SECRET'),
9 webhookSigningSecret: env('WEBHOOK_SIGNING_SECRET'),
10 playbackSigningId: env('SIGNING_KEY_ID'),
11 playbackSigningSecret: env('SIGNING_KEY_PRIVATE_KEY'),
12 }
13 }
14 // ...
15});
1// Path: ./config/plugins.js
2module.exports = ({env}) => ({
3 // ...
4 "mux-video-uploader": {
5 enabled: true,
6 config: {
7 accessTokenId: env('ACCESS_TOKEN_ID'),
8 secretKey: env('ACCESS_TOKEN_SECRET'),
9 webhookSigningSecret: env('WEBHOOK_SIGNING_SECRET'),
10 playbackSigningId: env('SIGNING_KEY_ID'),
11 playbackSigningSecret: env('SIGNING_KEY_PRIVATE_KEY'),
12 }
13 }
14 // ...
15});
Please note: We've currently disabled webhook signature verification as there is not a way to access the raw request body from the Koa.js middleware (which Strapi is using for parsing requests). This is needed to ensure that we are verifying the signature and that the request JSON payload has properties in the same order that was used for generating the signature.
When setting up your Webhook configuration in the Mux Dashboard, the "URL to notify" field should be in the format of—
1{STRAPI_BASE_URL}/mux-video-uploader/webhook-handler
Where {STRAPI_BASE_URL}
is the publicly accessible hostname of your Strapi instance.
Currently, anyone with "Super Admin" access to your Strapi instance will be able to utilize the plugin for uploading and managing content within the Strapi CE version. More sophisticated permissions can be defined for Strapi Enterprise users using RBAC.
Please note: End Users can only have read operation permissions (find
, findOne
and count
). Write operations are not supported due to potential security reasons.
Contributions, issues and feature requests are welcome!
Developers for this plugin should take a look at the README_INTERNAL.md
document for details on setting up dev environments.
If you encounter an error or have questions, please feel free to file inquiries on the Issues page for strapi-plugin-mux-video-uploader
.
Yes! However, in order to make it work, you'll need a "Webhook Relay" that runs from within your network. You can use a Webhook Relay service like Smee (https://smee.io/) or ngrok (https://ngrok.com/) to forward Webhook events to an instance of Strapi behind a firewall.
This happens when you need to rebuild your Strapi instance. To do this, you need delete the .cache
, .strapi
, and build
folders (while Strapi is off) and restart to rebuild the instance.
Here is an example of how to do this on a unix-based operating system from within the Strapi application root—
rm -rf ./.cache ./build ./.strapi
When uploading a video with custom text tracks, Mux asks for an URL pointing to these files. This feature currently works only on deployed Strapi installations.
When developing locally with Strapi, we don't have a globally reachable URL. Unlike webhooks with which we can use a local webhook proxy (e.g. Smee.io or ngrok), the plugin currently offers no way to configure a base URL to receive Mux's caption download requests. You'll still be able to upload videos, but the tracks won't be properly parsed by Mux.
Another approach would be to use tunnel service such as Cloudflare ZeroTrust or Tailscale to route requests against a publicly accessible hostname to your local instance. If you go this route, you will need to ensure that you configure Strapi to use the hostname when generating the Mux's caption download requests. Here is an example of how to do that—
1// Path: ./config/server.ts
2export default ({ env }) => ({
3 // ... Existing properties set by Strapi
4 url: env('PUBLIC_URL', 'https://your_host.domain.tld'),
5});
1// Path: ./config/server.js
2module.exports = ({ env }) => ({
3 // ... Existing properties set by Strapi
4 url: env('PUBLIC_URL', 'https://your_host.domain.tld'),
5});
npm install strapi-plugin-mux-video-uploader
Check out the available plugin resources that will help you to develop your plugin or provider and get it listed on the marketplace.