Gathering detailed insights and metrics for sanity-plugin-mux-input-fork
Gathering detailed insights and metrics for sanity-plugin-mux-input-fork
Gathering detailed insights and metrics for sanity-plugin-mux-input-fork
Gathering detailed insights and metrics for sanity-plugin-mux-input-fork
An input component that integrates Sanity Studio with MUX.com video encoding/hosting service.
npm install sanity-plugin-mux-input-fork
Typescript
Module System
Min. Node Version
Node Version
NPM Version
TypeScript (96.07%)
JavaScript (2.41%)
CSS (1.02%)
Shell (0.26%)
HTML (0.24%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
461 Commits
1 Branches
1 Contributors
Updated on Dec 15, 2023
Latest Version
2.2.4
Package Id
sanity-plugin-mux-input-fork@2.2.4
Unpacked Size
970.34 kB
Size
241.13 kB
File Count
93
NPM Version
10.2.3
Node Version
20.10.0
Published on
Dec 15, 2023
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
15
4
34
This is a Sanity Studio v3 plugin. For the v2 version, please refer to the v2-branch.
This plugin lets you use Mux video assets in your Sanity studio.
The Mux plugin for Sanity allows you to easily upload and preview videos.
Read our blog post about this plugin.
Not familiar with Sanity? Visit www.sanity.io
npm install sanity-plugin-mux-input
or
yarn add sanity-plugin-mux-input
npm i sanity-plugin-mux-input@studio-v3
.
Read more about using plugins in Sanity here.Make a schema type that uses the plugin's type mux.video
, for example:
1export default { 2 title: 'Video blog post', 3 name: 'videoBlogPost', 4 type: 'document', 5 fields: [ 6 {title: 'Title', name: 'title', type: 'string'}, 7 { 8 title: 'Video file', 9 name: 'video', 10 type: 'mux.video', 11 }, 12 ], 13}
muxInput
import to your plugins:1import {defineConfig} from 'sanity' 2import {muxInput} from 'sanity-plugin-mux-input' 3 4export default defineConfig({ 5 plugins: [muxInput()], 6})
Read more about schemas in Sanity here.
The Mux Video API uses an Access Token and Secret Key for authentication.
If you haven't already, generate a new Access Token in the Access Token settings of your Mux account dashboard, and make sure it got permission to both read and write video and read data.
The token is stored in the dataset as a document of the type mux.apiKey
with the id secrets.mux
.
Having the ID be non-root ensures that only editors are able to see it.
The Mux plugin will find its access tokens by fetching this document.
We recommend using Mux Player, try the Codesandbox example.
To enable signed urls with content uploaded to Mux, you will need to check the "Enable Signed Urls" option in the Mux Plugin configuration. Assuming that the API Access Token and Secret Key are set (as per the Quick start section).
More information for this feature of the plugin can be found on Mux's documentation
To enable static MP4 renditions, add mp4_support: 'standard'
to the options
of your mux.video
schema type.
1import {muxInput} from 'sanity-plugin-mux-input' 2 3export default defineConfig({ 4 plugins: [muxInput({mp4_support: 'standard'})], 5})
Currently, mp4_support
is the only supported MUX option and this supports a value of either standard
or none
(the default).
Issues are actively monitored and PRs are welcome. When developing this plugin the easiest setup is:
npm create sanity@dev-preview
. Follow the prompts, starting out with the blog template is a good way to go.cd
into your project directory, run npm install && npm start
- your sanity studio should be running on http://localhost:3333.cd
into the plugins
directory of your project.plugins
directory inside your project git clone git@github.com:your-fork/sanity-plugin-mux-input.git
.sanity.json
, go to the plugins
array and add mux-input
.npm start
.schemas/post.js
and add follow the plugin documentation to add a mux.video
type field.Run the "CI" workflow. Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.
On the studio-v2 branch this will result in:
latest
dist-tag.yarn add sanity-plugin-mux-input
or npm i sanity-plugin-mux-input
will fetch the new version.sanity install mux-input
will fetch the new version.On the main branch this will result in:
studio-v3
dist-tag.yarn add sanity-plugin-mux-input@studio-v3
or npm i sanity-plugin-mux-input@studio-v3
will fetch the new version.sanity install mux-input
won't fetch the new version.After Studio v3 turns stable this behavior will change. The v2 version will then be available on the studio-v2
dist-tag, and studio-v3
is upgraded to live on latest
.
npm test
MIT-licensed. See LICENSE.
This plugin uses @sanity/plugin-kit with default configuration for build & watch scripts.
See Testing a plugin in Sanity Studio on how to run this plugin with hotreload in the studio.
Run "CI & Release" workflow. Make sure to select the main branch and check "Release new version".
Semantic release will only release on configured branches, so it is safe to run release on any branch.
No vulnerabilities found.
No security vulnerabilities found.