Skip to content

aasthag-14/strapi-plugin-mux-video-uploader

 
 

Repository files navigation

Mux Video Uploader

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.

🤩 Features

  • Upload videos using a url or a file to Mux from inside of Strapi
  • Manage assets with the plugin's asset grid and pagination capabilities
  • Search for assets using title or Mux Asset ID values
  • Preview content using a player (powered by the mux-player-react project)
  • Delete assets which result in the Mux Asset also being deleted
  • Support uploading audio files
  • Mux updates Strapi automatically when the asset is ready using Webhooks

🧑‍💻 Install

For installing with Strapi v4, install the latest—

npm i strapi-plugin-mux-video-uploader@latest

yarn add strapi-plugin-mux-video-uploader@latest

For installing with Strapi v3, install v2.0.0—

🖐 Requirements

  • A Mux account
  • You will need both the Access Token and Secret Key scoped with "Full Access" permissions which can be created in the Mux Dashboard
  • The Webhook Signing Secret which can be created in the Mux Dashboard (See the Webhooks section for more info)
  • Tested with Strapi v4.5.1 Community Edition

⚙️ Configuration

In order for this plugin to communicate with Mux, some configuration values need to be set for the plugin before it can be used.

With your Access Token, Secret Key and Webhook Signing Secret, navigate to the Settings view within Strapi and click the "General" section under MUX VIDEO UPLOADER.

On this view, set the appropriate values to their fields and click the Save button.

🪝 Webhooks

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—

{STRAPI_BASE_URL}/mux-video-uploader/webhook-handler

Where {STRAPI_BASE_URL} is the publicly accessible hostname of your Strapi instance.

🧑‍⚖️ Permissions

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.

🤝 Contributing

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.

🗣 FAQ

My Strapi instance is not publicly available, can I still use Webhooks?

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.

I've installed the plugin, but the Strapi Admin UI doesn't show it

This happens when you need to rebuild your Strapi instance. To do this, you need delete the .cache 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

❤️ Thanks

Strapi.io

📚 References

About

A Strapi plugin for managing uploads to Mux.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.9%
  • Shell 0.1%