sanity-plugin-mux-input 2.9.1 → 2.10.1
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 +8 -8
- package/dist/index.d.mts +13 -5
- package/dist/index.d.ts +13 -5
- package/dist/index.js +2175 -1933
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2179 -1937
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/_exports/index.ts +13 -1
- package/src/actions/assets.ts +22 -0
- package/src/components/ConfigureApi.tsx +32 -9
- package/src/components/ImportVideosFromMux.tsx +26 -2
- package/src/components/Input.tsx +3 -3
- package/src/components/ResyncMetadata.tsx +201 -0
- package/src/components/UploadConfiguration.tsx +28 -28
- package/src/components/VideosBrowser.tsx +10 -2
- package/src/hooks/useImportMuxAssets.ts +3 -3
- package/src/hooks/useMuxAssets.ts +64 -53
- package/src/hooks/useResyncMuxMetadata.ts +143 -0
- package/src/schema.ts +4 -0
- package/src/util/assetTitlePlaceholder.ts +31 -0
- package/src/util/types.ts +20 -10
package/README.md
CHANGED
|
@@ -122,7 +122,7 @@ For reference, here's an example `mux.videoAsset` document:
|
|
|
122
122
|
thumbTime: 65.82,
|
|
123
123
|
// Full Mux asset data:
|
|
124
124
|
data: {
|
|
125
|
-
|
|
125
|
+
video_quality: 'plus',
|
|
126
126
|
max_resolution_tier: '1080p',
|
|
127
127
|
aspect_ratio: '16:9',
|
|
128
128
|
created_at: '1706645034',
|
|
@@ -228,25 +228,25 @@ export default defineConfig({
|
|
|
228
228
|
|
|
229
229
|
When uploading new assets, editors can still choose a lower resolution for each video than configured globally. This option controls the maximum resolution encoded or processed for the uploaded video. The option is particularly important to manage costs when uploaded videos are higher than `1080p` resolution. More information on the feature is available on Mux's [docs](https://docs.mux.com/guides/stream-videos-in-4k). Also, read more on this feature announcement on Mux's [blog](https://www.mux.com/blog/more-pixels-fewer-problems-introducing-4k-support-for-mux-video).
|
|
230
230
|
|
|
231
|
-
###
|
|
231
|
+
### Video Quality Level (plus or basic)
|
|
232
232
|
|
|
233
|
-
The [
|
|
233
|
+
The [video quality level](https://docs.mux.com/guides/use-video-quality-levels) informs the cost, quality, and available platform features for the asset. You can choose between `plus` and `basic` at the plugin configuration. Defaults to `plus`.
|
|
234
234
|
|
|
235
235
|
```js
|
|
236
236
|
import {muxInput} from 'sanity-plugin-mux-input'
|
|
237
237
|
|
|
238
238
|
export default defineConfig({
|
|
239
|
-
plugins: [muxInput({
|
|
239
|
+
plugins: [muxInput({video_quality: 'basic'})],
|
|
240
240
|
})
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
If `
|
|
243
|
+
If `video_quality: 'plus'`, editors can still choose to use the `basic` video quality level on a per-video basis when uploading new assets.
|
|
244
244
|
|
|
245
|
-
More information on the feature is available on Mux's [documentation](https://
|
|
245
|
+
More information on the feature is available on Mux's [documentation](https://www.mux.com/docs/guides/use-video-quality-levels). Also, read more on the feature announcement on Mux's [blog](https://www.mux.com/blog/our-next-pricing-lever-baseline-on-demand-assets-with-free-video-encoding)
|
|
246
246
|
|
|
247
247
|
### Auto-generated subtitles and captions
|
|
248
248
|
|
|
249
|
-
If you'
|
|
249
|
+
If you are using 'plus' video quality level, you can use Mux's [auto-generated subtitles](https://docs.mux.com/guides/video/auto-generated-subtitles) feature. Unless you pass `disableTextTrackConfig: true` to the configuration, users will be able to choose a language to auto-generate subtitles for uploaded videos. Refer to Mux's documentation for the list of supported languages.
|
|
250
250
|
|
|
251
251
|
You can also define a default language for the upload configuration form:
|
|
252
252
|
|
|
@@ -256,7 +256,7 @@ import {muxInput} from 'sanity-plugin-mux-input'
|
|
|
256
256
|
export default defineConfig({
|
|
257
257
|
plugins: [
|
|
258
258
|
muxInput({
|
|
259
|
-
|
|
259
|
+
video_quality: 'plus',
|
|
260
260
|
defaultAutogeneratedSubtitleLang: 'en', // choose from one of the supported languages
|
|
261
261
|
}),
|
|
262
262
|
],
|
package/dist/index.d.mts
CHANGED
|
@@ -79,24 +79,32 @@ export declare const muxInput: Plugin_2<void | Partial<PluginConfig>>
|
|
|
79
79
|
declare interface MuxInputConfig {
|
|
80
80
|
/**
|
|
81
81
|
* Enable static renditions by setting this to 'standard'. Can be overwritten on a per-asset basis.
|
|
82
|
-
* Requires `"
|
|
82
|
+
* Requires `"video_quality": "plus"`
|
|
83
83
|
* @see {@link https://docs.mux.com/guides/video/enable-static-mp4-renditions#why-enable-mp4-support}
|
|
84
84
|
* @defaultValue 'none'
|
|
85
85
|
*/
|
|
86
86
|
mp4_support: 'none' | 'standard'
|
|
87
87
|
/**
|
|
88
88
|
* Max resolution tier can be used to control the maximum resolution_tier your asset is encoded, stored, and streamed at.
|
|
89
|
-
* Requires `"
|
|
89
|
+
* Requires `"video_quality": "plus"`
|
|
90
90
|
* @see {@link https://docs.mux.com/guides/stream-videos-in-4k}
|
|
91
91
|
* @defaultValue '1080p'
|
|
92
92
|
*/
|
|
93
93
|
max_resolution_tier: '2160p' | '1440p' | '1080p'
|
|
94
94
|
/**
|
|
95
|
+
* @deprecated Use {@link video_quality}
|
|
96
|
+
* <br>
|
|
95
97
|
* The encoding tier informs the cost, quality, and available platform features for the asset.
|
|
96
98
|
* @see {@link https://docs.mux.com/guides/use-encoding-tiers}
|
|
97
99
|
* @defaultValue 'smart'
|
|
98
100
|
*/
|
|
99
|
-
encoding_tier
|
|
101
|
+
encoding_tier?: 'baseline' | 'smart'
|
|
102
|
+
/**
|
|
103
|
+
* The video quality level informs the cost, quality, and available platform features for the asset.
|
|
104
|
+
* @see {@link https://www.mux.com/docs/guides/use-video-quality-levels}
|
|
105
|
+
* @defaultValue 'plus'
|
|
106
|
+
*/
|
|
107
|
+
video_quality: 'basic' | 'plus' | 'premium'
|
|
100
108
|
/**
|
|
101
109
|
* Normalize the audio track loudness level.
|
|
102
110
|
* @see {@link https://docs.mux.com/guides/adjust-audio-levels#how-to-turn-on-audio-normalization}
|
|
@@ -111,7 +119,7 @@ declare interface MuxInputConfig {
|
|
|
111
119
|
defaultSigned?: boolean
|
|
112
120
|
/**
|
|
113
121
|
* Auto-generate captions for these languages by default.
|
|
114
|
-
* Requires `"
|
|
122
|
+
* Requires `"video_quality": "plus"`
|
|
115
123
|
*
|
|
116
124
|
* @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
|
|
117
125
|
* @deprecated use `defaultAutogeneratedSubtitleLang` instead. Only a single autogenerated
|
|
@@ -119,7 +127,7 @@ declare interface MuxInputConfig {
|
|
|
119
127
|
defaultAutogeneratedSubtitleLangs?: SupportedMuxLanguage[]
|
|
120
128
|
/**
|
|
121
129
|
* Auto-generate captions for this language by default. Users can still
|
|
122
|
-
* Requires `"
|
|
130
|
+
* Requires `"video_quality": "plus"`
|
|
123
131
|
*
|
|
124
132
|
* @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
|
|
125
133
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -79,24 +79,32 @@ export declare const muxInput: Plugin_2<void | Partial<PluginConfig>>
|
|
|
79
79
|
declare interface MuxInputConfig {
|
|
80
80
|
/**
|
|
81
81
|
* Enable static renditions by setting this to 'standard'. Can be overwritten on a per-asset basis.
|
|
82
|
-
* Requires `"
|
|
82
|
+
* Requires `"video_quality": "plus"`
|
|
83
83
|
* @see {@link https://docs.mux.com/guides/video/enable-static-mp4-renditions#why-enable-mp4-support}
|
|
84
84
|
* @defaultValue 'none'
|
|
85
85
|
*/
|
|
86
86
|
mp4_support: 'none' | 'standard'
|
|
87
87
|
/**
|
|
88
88
|
* Max resolution tier can be used to control the maximum resolution_tier your asset is encoded, stored, and streamed at.
|
|
89
|
-
* Requires `"
|
|
89
|
+
* Requires `"video_quality": "plus"`
|
|
90
90
|
* @see {@link https://docs.mux.com/guides/stream-videos-in-4k}
|
|
91
91
|
* @defaultValue '1080p'
|
|
92
92
|
*/
|
|
93
93
|
max_resolution_tier: '2160p' | '1440p' | '1080p'
|
|
94
94
|
/**
|
|
95
|
+
* @deprecated Use {@link video_quality}
|
|
96
|
+
* <br>
|
|
95
97
|
* The encoding tier informs the cost, quality, and available platform features for the asset.
|
|
96
98
|
* @see {@link https://docs.mux.com/guides/use-encoding-tiers}
|
|
97
99
|
* @defaultValue 'smart'
|
|
98
100
|
*/
|
|
99
|
-
encoding_tier
|
|
101
|
+
encoding_tier?: 'baseline' | 'smart'
|
|
102
|
+
/**
|
|
103
|
+
* The video quality level informs the cost, quality, and available platform features for the asset.
|
|
104
|
+
* @see {@link https://www.mux.com/docs/guides/use-video-quality-levels}
|
|
105
|
+
* @defaultValue 'plus'
|
|
106
|
+
*/
|
|
107
|
+
video_quality: 'basic' | 'plus' | 'premium'
|
|
100
108
|
/**
|
|
101
109
|
* Normalize the audio track loudness level.
|
|
102
110
|
* @see {@link https://docs.mux.com/guides/adjust-audio-levels#how-to-turn-on-audio-normalization}
|
|
@@ -111,7 +119,7 @@ declare interface MuxInputConfig {
|
|
|
111
119
|
defaultSigned?: boolean
|
|
112
120
|
/**
|
|
113
121
|
* Auto-generate captions for these languages by default.
|
|
114
|
-
* Requires `"
|
|
122
|
+
* Requires `"video_quality": "plus"`
|
|
115
123
|
*
|
|
116
124
|
* @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
|
|
117
125
|
* @deprecated use `defaultAutogeneratedSubtitleLang` instead. Only a single autogenerated
|
|
@@ -119,7 +127,7 @@ declare interface MuxInputConfig {
|
|
|
119
127
|
defaultAutogeneratedSubtitleLangs?: SupportedMuxLanguage[]
|
|
120
128
|
/**
|
|
121
129
|
* Auto-generate captions for this language by default. Users can still
|
|
122
|
-
* Requires `"
|
|
130
|
+
* Requires `"video_quality": "plus"`
|
|
123
131
|
*
|
|
124
132
|
* @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
|
|
125
133
|
*/
|