sanity-plugin-mux-input 1.1.6 → 1.2.0-main.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +41 -19
- package/lib/cjs/Input.ad849635.js +3585 -0
- package/lib/cjs/Input.ad849635.js.map +1 -0
- package/lib/cjs/Input.f632a169.js +410 -0
- package/lib/cjs/Input.f632a169.js.map +1 -0
- package/lib/cjs/Preview.3e13819d.js +53 -0
- package/lib/cjs/Preview.3e13819d.js.map +1 -0
- package/lib/cjs/index.js +381 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/Input.d47f0152.js +3582 -0
- package/lib/esm/Input.d47f0152.js.map +1 -0
- package/lib/esm/Input.e91a8018.js +407 -0
- package/lib/esm/Input.e91a8018.js.map +1 -0
- package/lib/esm/Preview.0ca0dc85.js +53 -0
- package/lib/esm/Preview.0ca0dc85.js.map +1 -0
- package/lib/esm/index.js +374 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/types/index.d.ts +15 -0
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +90 -50
- package/sanity.json +2 -10
- package/v2-incompatible.js +11 -0
- package/build/actions/assets.js +0 -37
- package/build/actions/assets.js.map +0 -1
- package/build/actions/secrets.js +0 -125
- package/build/actions/secrets.js.map +0 -1
- package/build/actions/upload.js +0 -280
- package/build/actions/upload.js.map +0 -1
- package/build/clients/SanityClient.js +0 -19
- package/build/clients/SanityClient.js.map +0 -1
- package/build/clients/upChunkObservable.js +0 -66
- package/build/clients/upChunkObservable.js.map +0 -1
- package/build/components/FileInputButton.js +0 -84
- package/build/components/FileInputButton.js.map +0 -1
- package/build/components/Input.css +0 -30
- package/build/components/Input.js +0 -821
- package/build/components/Input.js.map +0 -1
- package/build/components/MuxLogo.js +0 -19
- package/build/components/MuxLogo.js.map +0 -1
- package/build/components/Preview.css +0 -16
- package/build/components/Preview.js +0 -95
- package/build/components/Preview.js.map +0 -1
- package/build/components/SelectAsset.css +0 -56
- package/build/components/SelectAsset.js +0 -162
- package/build/components/SelectAsset.js.map +0 -1
- package/build/components/Setup.css +0 -7
- package/build/components/Setup.js +0 -311
- package/build/components/Setup.js.map +0 -1
- package/build/components/UploadPlaceholder.css +0 -81
- package/build/components/UploadPlaceholder.js +0 -92
- package/build/components/UploadPlaceholder.js.map +0 -1
- package/build/components/Uploader.css +0 -28
- package/build/components/Uploader.js +0 -534
- package/build/components/Uploader.js.map +0 -1
- package/build/components/Video.css +0 -21
- package/build/components/Video.js +0 -360
- package/build/components/Video.js.map +0 -1
- package/build/config.js +0 -17
- package/build/config.js.map +0 -1
- package/build/index.js +0 -22
- package/build/index.js.map +0 -1
- package/build/schema/mux.video.js +0 -41
- package/build/schema/mux.video.js.map +0 -1
- package/build/schema/mux.videoAsset.js +0 -29
- package/build/schema/mux.videoAsset.js.map +0 -1
- package/build/util/extractFiles.js +0 -70
- package/build/util/extractFiles.js.map +0 -1
- package/build/util/formatTime.js +0 -28
- package/build/util/formatTime.js.map +0 -1
- package/build/util/generateJwt.js +0 -30
- package/build/util/generateJwt.js.map +0 -1
- package/build/util/getPosterSrc.js +0 -46
- package/build/util/getPosterSrc.js.map +0 -1
- package/build/util/getStoryboardSrc.js +0 -26
- package/build/util/getStoryboardSrc.js.map +0 -1
- package/build/util/getVideoSrc.js +0 -23
- package/build/util/getVideoSrc.js.map +0 -1
- package/config.dist.json +0 -3
package/README.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Mux Video Input Sanity Plugin
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **NOTE**
|
|
4
|
+
>
|
|
5
|
+
> This is the **Sanity Studio v3 version** of sanity-plugin-mux-input.
|
|
6
|
+
>
|
|
7
|
+
> For the v2 version, please refer to the [studio-v2 branch](https://github.com/sanity-io/sanity-plugin-mux-input).
|
|
8
|
+
|
|
9
|
+
This is a plugin that let you use [Mux](https://www.mux.com) video assets in your Sanity studio.
|
|
4
10
|
|
|
5
11
|
The Mux plugin for Sanity gives you a way to upload and preview videos easily.
|
|
6
12
|
|
|
@@ -10,8 +16,8 @@ Not familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)
|
|
|
10
16
|
|
|
11
17
|
## Quick start
|
|
12
18
|
|
|
13
|
-
- While in your project folder, run `
|
|
14
|
-
Read more about [using plugins in Sanity here](https://
|
|
19
|
+
- While in your project folder, run `npm i sanity-plugin-mux-input`.
|
|
20
|
+
Read more about [using plugins in Sanity here](https://beta.sanity.io/docs/platform/studio/plugin).
|
|
15
21
|
|
|
16
22
|
* Make a schema type that uses the plugin's type `mux.video`, for example:
|
|
17
23
|
|
|
@@ -43,11 +49,11 @@ Not familiar with Sanity? [Visit www.sanity.io](https://www.sanity.io/)
|
|
|
43
49
|
The token is stored in the dataset as a document of the type `mux.apiKey` with the id `secrets.mux`.
|
|
44
50
|
Having the ID be non-root ensures that only editors are able to see it.
|
|
45
51
|
|
|
46
|
-
The Mux plugin will find
|
|
52
|
+
The Mux plugin will find its access tokens by fetching this document.
|
|
47
53
|
|
|
48
54
|
# Playing videos in the frontend
|
|
49
55
|
|
|
50
|
-
We have made
|
|
56
|
+
We have made our own player which supports poster images for the videos as set with this plugin, see [`sanity-mux-player`](https://github.com/sanity-io/sanity-mux-player)
|
|
51
57
|
|
|
52
58
|
You could use any player which supports HLS, just point the video source to:
|
|
53
59
|
|
|
@@ -61,36 +67,52 @@ More information for this feature of the plugin can be found on Mux's [documenta
|
|
|
61
67
|
|
|
62
68
|
# Enabling MP4 support
|
|
63
69
|
|
|
64
|
-
To enable [static MP4 renditions](https://docs.mux.com/guides/video/enable-static-mp4-renditions),
|
|
70
|
+
To enable [static MP4 renditions](https://docs.mux.com/guides/video/enable-static-mp4-renditions), add `mp4_support: 'standard'` to the `options` of your `mux.video` schema type.
|
|
71
|
+
|
|
72
|
+
js```
|
|
73
|
+
import {muxInput} from 'sanity-plugin-mux-input'
|
|
74
|
+
|
|
75
|
+
export deafult createConfig({
|
|
76
|
+
plugins: [muxInput({
|
|
77
|
+
mp4_support: "standard"
|
|
78
|
+
})]
|
|
79
|
+
})
|
|
65
80
|
|
|
66
|
-
```
|
|
67
|
-
{
|
|
68
|
-
"mp4_support": "standard"
|
|
69
|
-
}
|
|
70
81
|
```
|
|
71
82
|
|
|
72
|
-
Currently `mp4_support` is the only supported MUX option and this supports a value of either `standard` or `none` (the default).
|
|
83
|
+
Currently, `mp4_support` is the only supported MUX option and this supports a value of either `standard` or `none` (the default).
|
|
73
84
|
|
|
74
85
|
# Contributing
|
|
75
86
|
|
|
76
87
|
Issues are actively monitored and PRs are welcome. When developing this plugin the easiest setup is:
|
|
77
88
|
|
|
78
89
|
1. Fork this repo.
|
|
79
|
-
1.
|
|
90
|
+
1. Create a studio v3 project: `npm create sanity@dev-preview`. Follow the prompts, starting out with the blog template is a good way to go.
|
|
80
91
|
1. `cd` into your project directory, run `npm install && npm start` - your sanity studio should be running on http://localhost:3333.
|
|
81
|
-
1. `cd` into the `plugins`
|
|
92
|
+
1. `cd` into the `plugins` directory of your project.
|
|
82
93
|
1. Fork this repo and clone your fork into the `plugins` directory inside your project `git clone git@github.com:your-fork/sanity-plugin-mux-input.git`.
|
|
83
94
|
1. Open `sanity.json`, go to the `plugins` array and add `mux-input`.
|
|
84
95
|
1. Re-start the sanity studio server with `npm start`.
|
|
85
96
|
1. Edit `schemas/post.js` and add follow the plugin documentation to add a `mux.video` type field.
|
|
86
|
-
1. Your studio should reload, and now when you edit the plugin code it should reload the studio, when you're done
|
|
97
|
+
1. Your studio should reload, and now when you edit the plugin code it should reload the studio, when you're done creating a branch, put in a PR and a maintainer will review it. Thank you!
|
|
98
|
+
|
|
99
|
+
# Publishing
|
|
87
100
|
|
|
88
|
-
|
|
101
|
+
Publishing is done by pushing [Conventional Commits](https://github.com/semantic-release/semantic-release#how-does-it-work).
|
|
102
|
+
On the [studio-v2](/tree/studio-v2) branch this will result in:
|
|
89
103
|
|
|
90
|
-
|
|
104
|
+
- a new version on the `latest` dist-tag.
|
|
105
|
+
- running `yarn add sanity-plugin-mux-input` or `npm i sanity-plugin-mux-input` will fetch the new version.
|
|
106
|
+
- running `sanity install mux-input` will fetch the new version.
|
|
107
|
+
- studio-v3 users are unaffected.
|
|
108
|
+
On the [main](/tree/main) branch this will result in:
|
|
109
|
+
- a new prerelease version on the `studio-v3` dist-tag.
|
|
110
|
+
- running `yarn add sanity-plugin-mux-input@studio-v3` or `npm i sanity-plugin-mux-input@studio-v3` will fetch the new version.
|
|
111
|
+
- running `sanity install mux-input` won't fetch the new version.
|
|
91
112
|
|
|
92
|
-
`
|
|
113
|
+
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`.
|
|
93
114
|
|
|
94
|
-
|
|
115
|
+
# Test
|
|
95
116
|
|
|
96
|
-
`
|
|
117
|
+
`npm test`
|
|
118
|
+
```
|