sanity-plugin-mux-input 2.19.1 → 3.0.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/dist/index.d.ts CHANGED
@@ -1,87 +1,87 @@
1
- import type MuxPlayerElement from '@mux/mux-player'
2
- import type {PartialDeep} from 'type-fest'
3
- import {Plugin as Plugin_2} from 'sanity'
1
+ import type MuxPlayerElement from "@mux/mux-player";
2
+ import type { PartialDeep } from "type-fest";
3
+ import { Plugin as Plugin_2 } from "sanity";
4
4
 
5
- export declare const defaultConfig: PluginConfig
5
+ export declare const defaultConfig: PluginConfig;
6
6
 
7
7
  declare interface MuxAsset {
8
- id: string
8
+ id: string;
9
9
  /** In seconds (instead of JS's default milliseconds) */
10
- created_at: string
11
- status: 'preparing' | 'ready' | 'errored'
12
- duration: number
13
- max_stored_resolution: 'Audio only' | 'SD' | 'HD' | 'FHD' | 'UHD'
14
- max_stored_frame_rate: -1 | number
15
- aspect_ratio: `${number}:${number}`
16
- playback_ids: MuxPlaybackId[]
17
- tracks: MuxTrack[]
18
- errors?: MuxErrors
19
- upload_id: string
20
- is_live?: boolean
21
- passthrough: string
22
- live_stream_id?: string
10
+ created_at: string;
11
+ status: "preparing" | "ready" | "errored";
12
+ duration: number;
13
+ max_stored_resolution: "Audio only" | "SD" | "HD" | "FHD" | "UHD";
14
+ max_stored_frame_rate: -1 | number;
15
+ aspect_ratio: `${number}:${number}`;
16
+ playback_ids: MuxPlaybackId[];
17
+ tracks: MuxTrack[];
18
+ errors?: MuxErrors;
19
+ upload_id: string;
20
+ is_live?: boolean;
21
+ passthrough: string;
22
+ live_stream_id?: string;
23
23
  master?: {
24
- status: 'ready' | 'preparing' | 'errored'
25
- url: string
26
- }
27
- master_access: 'temporary' | 'none'
28
- mp4_support: 'standard' | 'none'
29
- source_asset_id?: string
30
- normalize_audio?: boolean
24
+ status: "ready" | "preparing" | "errored";
25
+ url: string;
26
+ };
27
+ master_access: "temporary" | "none";
28
+ mp4_support: "standard" | "none";
29
+ source_asset_id?: string;
30
+ normalize_audio?: boolean;
31
31
  static_renditions?: {
32
- status: 'ready' | 'preparing' | 'disabled' | 'errored'
32
+ status: "ready" | "preparing" | "disabled" | "errored";
33
33
  files: {
34
- name: string
35
- ext: 'mp4' | 'm4a'
36
- height: number
37
- width: number
38
- bitrate: number
39
- filesize: string
40
- type: 'standard' | 'advanced'
41
- status: 'ready' | 'preparing' | 'skipped' | 'errored'
42
- resolution_tier?: string
43
- resolution?: string
44
- id: string
45
- passthrough?: string
46
- }[]
47
- }
34
+ name: string;
35
+ ext: "mp4" | "m4a";
36
+ height: number;
37
+ width: number;
38
+ bitrate: number;
39
+ filesize: string;
40
+ type: "standard" | "advanced";
41
+ status: "ready" | "preparing" | "skipped" | "errored";
42
+ resolution_tier?: string;
43
+ resolution?: string;
44
+ id: string;
45
+ passthrough?: string;
46
+ }[];
47
+ };
48
48
  recording_times?: {
49
- started_at: string
50
- duration: number
51
- type: 'content' | 'slate'
52
- }[]
49
+ started_at: string;
50
+ duration: number;
51
+ type: "content" | "slate";
52
+ }[];
53
53
  non_standard_input_reasons?: {
54
- video_codec?: string
55
- audio_codec?: string
56
- video_gop_size?: 'high'
57
- video_frame_rate?: string
58
- video_resolution?: string
59
- video_bitrate?: 'high'
60
- pixel_aspect_ratio?: string
61
- video_edit_list?: 'non-standard'
62
- audio_edit_list?: 'non-standard'
63
- unexpected_media_file_parameters?: 'non-standard'
64
- test?: boolean
65
- }
54
+ video_codec?: string;
55
+ audio_codec?: string;
56
+ video_gop_size?: "high";
57
+ video_frame_rate?: string;
58
+ video_resolution?: string;
59
+ video_bitrate?: "high";
60
+ pixel_aspect_ratio?: string;
61
+ video_edit_list?: "non-standard";
62
+ audio_edit_list?: "non-standard";
63
+ unexpected_media_file_parameters?: "non-standard";
64
+ test?: boolean;
65
+ };
66
66
  meta?: {
67
- title?: string
68
- }
67
+ title?: string;
68
+ };
69
69
  }
70
70
 
71
71
  declare interface MuxAudioTrack {
72
- type: 'audio'
73
- id: string
74
- duration?: number
75
- max_channels: number
76
- max_channel_layout: 'stereo' | string
72
+ type: "audio";
73
+ id: string;
74
+ duration?: number;
75
+ max_channels: number;
76
+ max_channel_layout: "stereo" | string;
77
77
  }
78
78
 
79
79
  declare interface MuxErrors {
80
- type: string
81
- messages: string[]
80
+ type: string;
81
+ messages: string[];
82
82
  }
83
83
 
84
- export declare const muxInput: Plugin_2<void | Partial<PluginConfig>>
84
+ export declare const muxInput: Plugin_2<void | Partial<PluginConfig>>;
85
85
 
86
86
  declare interface MuxInputConfig {
87
87
  /**
@@ -95,7 +95,7 @@ declare interface MuxInputConfig {
95
95
  * @see {@link https://docs.mux.com/guides/video/enable-static-mp4-renditions}
96
96
  * @defaultValue []
97
97
  */
98
- static_renditions: StaticRenditionResolution[]
98
+ static_renditions: StaticRenditionResolution[];
99
99
  /**
100
100
  * @deprecated Use `static_renditions` instead. This field is kept for backward compatibility.
101
101
  * Enable static renditions by setting this to 'standard'. Can be overwritten on a per-asset basis.
@@ -103,14 +103,14 @@ declare interface MuxInputConfig {
103
103
  * @see {@link https://docs.mux.com/guides/video/enable-static-mp4-renditions#why-enable-mp4-support}
104
104
  * @defaultValue 'none'
105
105
  */
106
- mp4_support: 'none' | 'standard'
106
+ mp4_support: "none" | "standard";
107
107
  /**
108
108
  * Max resolution tier can be used to control the maximum resolution_tier your asset is encoded, stored, and streamed at.
109
109
  * Requires `"video_quality": "plus"`
110
110
  * @see {@link https://docs.mux.com/guides/stream-videos-in-4k}
111
111
  * @defaultValue '1080p'
112
112
  */
113
- max_resolution_tier: '2160p' | '1440p' | '1080p'
113
+ max_resolution_tier: "2160p" | "1440p" | "1080p";
114
114
  /**
115
115
  * @deprecated Use {@link video_quality}
116
116
  * <br>
@@ -118,36 +118,36 @@ declare interface MuxInputConfig {
118
118
  * @see {@link https://docs.mux.com/guides/use-encoding-tiers}
119
119
  * @defaultValue 'smart'
120
120
  */
121
- encoding_tier?: 'baseline' | 'smart'
121
+ encoding_tier?: "baseline" | "smart";
122
122
  /**
123
123
  * The video quality level informs the cost, quality, and available platform features for the asset.
124
124
  * @see {@link https://www.mux.com/docs/guides/use-video-quality-levels}
125
125
  * @defaultValue 'plus'
126
126
  */
127
- video_quality: 'basic' | 'plus' | 'premium'
127
+ video_quality: "basic" | "plus" | "premium";
128
128
  /**
129
129
  * Normalize the audio track loudness level.
130
130
  * @see {@link https://docs.mux.com/guides/adjust-audio-levels#how-to-turn-on-audio-normalization}
131
131
  * @defaultValue false
132
132
  */
133
- normalize_audio: boolean
133
+ normalize_audio: boolean;
134
134
  /**
135
135
  * Enables signed URLs by default, if you configured them with your API token.
136
136
  * @see {@link https://docs.mux.com/guides/secure-video-playback}
137
137
  * @defaultValue false
138
138
  */
139
- defaultSigned?: boolean
139
+ defaultSigned?: boolean;
140
140
  /**
141
141
  * Enables public URLs by default.
142
142
  * @defaultValue true
143
143
  */
144
- defaultPublic?: boolean
144
+ defaultPublic?: boolean;
145
145
  /**
146
146
  * Enables DRM Protection by default, if you configured your DRM Configuration Id.
147
147
  * @see {@link https://www.mux.com/docs/guides/protect-videos-with-drm}
148
148
  * @defaultValue true
149
149
  */
150
- defaultDrm?: boolean
150
+ defaultDrm?: boolean;
151
151
  /**
152
152
  * Auto-generate captions for these languages by default.
153
153
  * Requires `"video_quality": "plus"`
@@ -155,14 +155,14 @@ declare interface MuxInputConfig {
155
155
  * @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
156
156
  * @deprecated use `defaultAutogeneratedSubtitleLang` instead. Only a single autogenerated
157
157
  */
158
- defaultAutogeneratedSubtitleLangs?: SupportedMuxLanguage[]
158
+ defaultAutogeneratedSubtitleLangs?: SupportedMuxLanguage[];
159
159
  /**
160
160
  * Auto-generate captions for this language by default. Users can still
161
161
  * Requires `"video_quality": "plus"`
162
162
  *
163
163
  * @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
164
164
  */
165
- defaultAutogeneratedSubtitleLang?: SupportedMuxLanguage
165
+ defaultAutogeneratedSubtitleLang?: SupportedMuxLanguage;
166
166
  /**
167
167
  * Whether or not to allow content editors to override asset upload
168
168
  * configuration settings when uploading a video to Mux.
@@ -170,7 +170,7 @@ declare interface MuxInputConfig {
170
170
  * @see {@link https://docs.mux.com/guides/secure-video-playback}
171
171
  * @defaultValue false
172
172
  */
173
- disableUploadConfig?: boolean
173
+ disableUploadConfig?: boolean;
174
174
  /**
175
175
  * Whether or not to allow content editors to add text tracks alongside their
176
176
  * asset when uploading a video to Mux.
@@ -178,13 +178,13 @@ declare interface MuxInputConfig {
178
178
  * @see {@link https://docs.mux.com/guides/secure-video-playback}
179
179
  * @defaultValue false
180
180
  */
181
- disableTextTrackConfig?: boolean
181
+ disableTextTrackConfig?: boolean;
182
182
  /**
183
183
  * Whether or not to show the playback warning when trying to watch DRM content for the first time.
184
184
  *
185
185
  * @defaultValue false
186
186
  */
187
- disableDrmPlaybackWarning?: boolean
187
+ disableDrmPlaybackWarning?: boolean;
188
188
  /**
189
189
  * The mime types that are accepted by the input.
190
190
  *
@@ -192,7 +192,7 @@ declare interface MuxInputConfig {
192
192
  * @defaultValue ['video/*','audio/*']
193
193
 
194
194
  */
195
- acceptedMimeTypes?: ('audio/*' | 'video/*')[]
195
+ acceptedMimeTypes?: ("audio/*" | "video/*")[];
196
196
  /**
197
197
  * Maximum file size allowed for video uploads in bytes.
198
198
  * If not specified, no file size validation will be performed.
@@ -200,7 +200,7 @@ declare interface MuxInputConfig {
200
200
  * @example 1024 * 1024 * 1024 // 1 GB
201
201
  * @defaultValue undefined
202
202
  */
203
- maxAssetFileSize?: number
203
+ maxAssetFileSize?: number;
204
204
  /**
205
205
  * Maximum video duration allowed in seconds.
206
206
  * If not specified, no duration validation will be performed.
@@ -208,7 +208,7 @@ declare interface MuxInputConfig {
208
208
  * @example 2 * 60 * 60 // 2 hours
209
209
  * @defaultValue undefined
210
210
  */
211
- maxAssetDuration?: number
211
+ maxAssetDuration?: number;
212
212
  /**
213
213
  * HLS.js configuration options to be passed to the Mux Player.
214
214
  * These options allow you to customize the underlying HLS.js playback engine behavior.
@@ -224,47 +224,47 @@ declare interface MuxInputConfig {
224
224
  * }
225
225
  * ```
226
226
  */
227
- hlsConfig?: MuxPlayerElement['_hlsConfig']
227
+ hlsConfig?: MuxPlayerElement["_hlsConfig"];
228
228
  }
229
229
 
230
230
  declare interface MuxPlaybackId {
231
- id: string
232
- policy: PlaybackPolicy
231
+ id: string;
232
+ policy: PlaybackPolicy;
233
233
  }
234
234
 
235
235
  declare interface MuxTextTrack {
236
- type: 'text'
237
- id: string
238
- text_type?: 'subtitles'
236
+ type: "text";
237
+ id: string;
238
+ text_type?: "subtitles";
239
239
  text_source?:
240
- | 'uploaded'
241
- | 'embedded'
242
- | 'generated_live'
243
- | 'generated_live_final'
244
- | 'generated_vod'
245
- language_code?: 'en' | 'en-US' | string
246
- name?: 'English' | string
247
- closed_captions?: boolean
248
- passthrough?: string
249
- status: 'preparing' | 'ready' | 'errored'
240
+ | "uploaded"
241
+ | "embedded"
242
+ | "generated_live"
243
+ | "generated_live_final"
244
+ | "generated_vod";
245
+ language_code?: "en" | "en-US" | string;
246
+ name?: "English" | string;
247
+ closed_captions?: boolean;
248
+ passthrough?: string;
249
+ status: "preparing" | "ready" | "errored";
250
250
  error?: {
251
- type: string
252
- messages?: string[]
253
- }
251
+ type: string;
252
+ messages?: string[];
253
+ };
254
254
  }
255
255
 
256
- declare type MuxTrack = MuxVideoTrack | MuxAudioTrack | MuxTextTrack
256
+ declare type MuxTrack = MuxVideoTrack | MuxAudioTrack | MuxTextTrack;
257
257
 
258
258
  declare interface MuxVideoTrack {
259
- type: 'video'
260
- id: string
261
- max_width: number
262
- max_height: number
263
- max_frame_rate: -1 | number
264
- duration?: number
259
+ type: "video";
260
+ id: string;
261
+ max_width: number;
262
+ max_height: number;
263
+ max_frame_rate: -1 | number;
264
+ duration?: number;
265
265
  }
266
266
 
267
- declare type PlaybackPolicy = 'signed' | 'public' | 'drm'
267
+ declare type PlaybackPolicy = "signed" | "public" | "drm";
268
268
 
269
269
  declare interface PluginConfig extends MuxInputConfig {
270
270
  /**
@@ -276,71 +276,72 @@ declare interface PluginConfig extends MuxInputConfig {
276
276
  tool:
277
277
  | false
278
278
  | {
279
- title?: string
280
- icon?: React.ComponentType
281
- }
279
+ title?: string;
280
+ icon?: React.ComponentType;
281
+ };
282
282
  /**
283
283
  * The roles that are allowed to configure the plugin.
284
284
  *
285
285
  * If not set, all roles will be allowed to configure the plugin.
286
286
  * @defaultValue []
287
287
  */
288
- allowedRolesForConfiguration: string[]
288
+ allowedRolesForConfiguration: string[];
289
289
  }
290
290
 
291
291
  /**
292
292
  * All static rendition resolution options supported by Mux
293
293
  */
294
294
  declare type StaticRenditionResolution =
295
- | 'highest'
296
- | 'audio-only'
297
- | '270p'
298
- | '360p'
299
- | '480p'
300
- | '540p'
301
- | '720p'
302
- | '1080p'
303
- | '1440p'
304
- | '2160p'
295
+ | "highest"
296
+ | "audio-only"
297
+ | "270p"
298
+ | "360p"
299
+ | "480p"
300
+ | "540p"
301
+ | "720p"
302
+ | "1080p"
303
+ | "1440p"
304
+ | "2160p";
305
305
 
306
306
  declare const SUPPORTED_MUX_LANGUAGES_VALUES: (
307
- | 'en'
308
- | 'es'
309
- | 'it'
310
- | 'pt'
311
- | 'de'
312
- | 'fr'
313
- | 'pl'
314
- | 'ru'
315
- | 'nl'
316
- | 'ca'
317
- | 'tr'
318
- | 'sv'
319
- | 'uk'
320
- | 'no'
321
- | 'fi'
322
- | 'sk'
323
- | 'el'
324
- | 'cs'
325
- | 'hr'
326
- | 'da'
327
- | 'ro'
328
- | 'bg'
329
- )[]
307
+ | "en"
308
+ | "es"
309
+ | "it"
310
+ | "pt"
311
+ | "de"
312
+ | "fr"
313
+ | "pl"
314
+ | "ru"
315
+ | "nl"
316
+ | "ca"
317
+ | "tr"
318
+ | "sv"
319
+ | "uk"
320
+ | "no"
321
+ | "fi"
322
+ | "sk"
323
+ | "el"
324
+ | "cs"
325
+ | "hr"
326
+ | "da"
327
+ | "ro"
328
+ | "bg"
329
+ )[];
330
330
 
331
- declare type SupportedMuxLanguage = (typeof SUPPORTED_MUX_LANGUAGES_VALUES)[number]
331
+ declare type SupportedMuxLanguage =
332
+ (typeof SUPPORTED_MUX_LANGUAGES_VALUES)[number];
332
333
 
333
334
  export declare interface VideoAssetDocument {
334
- _id: string
335
- _type: 'mux.videoAsset'
336
- _createdAt: string
337
- _updatedAt?: string
338
- status?: string
339
- assetId?: string
340
- playbackId?: string
341
- filename?: string
342
- thumbTime?: number
343
- data?: PartialDeep<MuxAsset>
335
+ _id: string;
336
+ _type: "mux.videoAsset";
337
+ _createdAt: string;
338
+ _updatedAt?: string;
339
+ status?: string;
340
+ assetId?: string;
341
+ playbackId?: string;
342
+ filename?: string;
343
+ thumbTime?: number;
344
+ data?: PartialDeep<MuxAsset>;
344
345
  }
345
346
 
346
- export {}
347
+ export {};