sanity-plugin-mux-input 2.3.3 → 2.3.5

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/src/schema.ts ADDED
@@ -0,0 +1,181 @@
1
+ export const muxVideoSchema = {
2
+ name: 'mux.video',
3
+ type: 'object',
4
+ title: 'Video asset reference',
5
+ fields: [
6
+ {
7
+ title: 'Video',
8
+ name: 'asset',
9
+ type: 'reference',
10
+ weak: true,
11
+ to: [{type: 'mux.videoAsset'}],
12
+ },
13
+ ],
14
+ }
15
+
16
+ const muxTrack = {
17
+ name: 'mux.track',
18
+ type: 'object',
19
+ fields: [
20
+ {type: 'string', name: 'id'},
21
+ {type: 'string', name: 'type'},
22
+ {type: 'number', name: 'max_width'},
23
+ {type: 'number', name: 'max_frame_rate'},
24
+ {type: 'number', name: 'duration'},
25
+ {type: 'number', name: 'max_height'},
26
+ ],
27
+ }
28
+
29
+ const muxPlaybackId = {
30
+ name: 'mux.playbackId',
31
+ type: 'object',
32
+ fields: [
33
+ {type: 'string', name: 'id'},
34
+ {type: 'string', name: 'policy'},
35
+ ],
36
+ }
37
+
38
+ const muxStaticRenditionFile = {
39
+ name: 'mux.staticRenditionFile',
40
+ type: 'object',
41
+ fields: [
42
+ {type: 'string', name: 'ext'},
43
+ {type: 'string', name: 'name'},
44
+ {type: 'number', name: 'width'},
45
+ {type: 'number', name: 'bitrate'},
46
+ {type: 'number', name: 'filesize'},
47
+ {type: 'number', name: 'height'},
48
+ ],
49
+ }
50
+
51
+ const muxStaticRenditions = {
52
+ name: 'mux.staticRenditions',
53
+ type: 'object',
54
+ fields: [
55
+ {type: 'string', name: 'status'},
56
+ {
57
+ name: 'files',
58
+ type: 'array',
59
+ of: [{type: 'mux.staticRenditionFile'}],
60
+ },
61
+ ],
62
+ }
63
+
64
+ const muxAssetData = {
65
+ name: 'mux.assetData',
66
+ title: 'Mux asset data',
67
+ type: 'object',
68
+ fields: [
69
+ {
70
+ type: 'string',
71
+ name: 'resolution_tier',
72
+ },
73
+ {
74
+ type: 'string',
75
+ name: 'upload_id',
76
+ },
77
+ {
78
+ type: 'string',
79
+ name: 'created_at',
80
+ },
81
+ {
82
+ type: 'string',
83
+ name: 'id',
84
+ },
85
+ {
86
+ type: 'string',
87
+ name: 'status',
88
+ },
89
+ {
90
+ type: 'string',
91
+ name: 'max_stored_resolution',
92
+ },
93
+ {
94
+ type: 'string',
95
+ name: 'passthrough',
96
+ },
97
+ {
98
+ type: 'string',
99
+ name: 'encoding_tier',
100
+ },
101
+ {
102
+ type: 'string',
103
+ name: 'master_access',
104
+ },
105
+ {
106
+ type: 'string',
107
+ name: 'aspect_ratio',
108
+ },
109
+ {
110
+ type: 'number',
111
+ name: 'duration',
112
+ },
113
+ {
114
+ type: 'number',
115
+ name: 'max_stored_frame_rate',
116
+ },
117
+ {
118
+ type: 'string',
119
+ name: 'mp4_support',
120
+ },
121
+ {
122
+ type: 'string',
123
+ name: 'max_resolution_tier',
124
+ },
125
+ {
126
+ name: 'tracks',
127
+ type: 'array',
128
+ of: [{type: 'mux.track'}],
129
+ },
130
+ {
131
+ name: 'playback_ids',
132
+ type: 'array',
133
+ of: [{type: 'mux.playbackId'}],
134
+ },
135
+ {
136
+ name: 'static_renditions',
137
+ type: 'mux.staticRenditions',
138
+ },
139
+ ],
140
+ }
141
+
142
+ const muxVideoAsset = {
143
+ name: 'mux.videoAsset',
144
+ type: 'object',
145
+ title: 'Video asset',
146
+ fields: [
147
+ {
148
+ type: 'string',
149
+ name: 'status',
150
+ },
151
+ {
152
+ type: 'string',
153
+ name: 'assetId',
154
+ },
155
+ {
156
+ type: 'string',
157
+ name: 'playbackId',
158
+ },
159
+ {
160
+ type: 'string',
161
+ name: 'filename',
162
+ },
163
+ {
164
+ type: 'number',
165
+ name: 'thumbTime',
166
+ },
167
+ {
168
+ type: 'mux.assetData',
169
+ name: 'data',
170
+ },
171
+ ],
172
+ }
173
+
174
+ export const schemaTypes = [
175
+ muxTrack,
176
+ muxPlaybackId,
177
+ muxStaticRenditionFile,
178
+ muxStaticRenditions,
179
+ muxAssetData,
180
+ muxVideoAsset,
181
+ ]
@@ -11,3 +11,5 @@ export const THUMBNAIL_ASPECT_RATIO = 16 / 9
11
11
 
12
12
  /** To prevent excessive height, thumbnails and input should not go beyond to this aspect ratio. */
13
13
  export const MIN_ASPECT_RATIO = 5 / 4
14
+
15
+ export const AUDIO_ASPECT_RATIO = 5 / 1
@@ -24,10 +24,10 @@ export function generateJwt<T extends Audience>(
24
24
  ): string {
25
25
  const {signingKeyId, signingKeyPrivate} = readSecrets(client)
26
26
  if (!signingKeyId) {
27
- throw new TypeError('Missing signingKeyId')
27
+ throw new TypeError("Missing `signingKeyId`.\n Check your plugin's configuration")
28
28
  }
29
29
  if (!signingKeyPrivate) {
30
- throw new TypeError('Missing signingKeyPrivate')
30
+ throw new TypeError("Missing `signingKeyPrivate`.\n Check your plugin's configuration")
31
31
  }
32
32
 
33
33
  // @ts-expect-error - handle missing typings for this package
package/src/util/types.ts CHANGED
@@ -43,11 +43,19 @@ export interface MuxInputConfig {
43
43
  * Auto-generate captions for these languages by default.
44
44
  * Requires `"encoding_tier": "smart"`
45
45
  *
46
- * @see {@link https://docs.mux.com/guides/secure-video-playback}
47
- * @defaultValue false
46
+ * @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
47
+ * @deprecated use `defaultAutogeneratedSubtitleLang` instead. Only a single autogenerated
48
48
  */
49
49
  defaultAutogeneratedSubtitleLangs?: SupportedMuxLanguage[]
50
50
 
51
+ /**
52
+ * Auto-generate captions for this language by default. Users can still
53
+ * Requires `"encoding_tier": "smart"`
54
+ *
55
+ * @see {@link https://docs.mux.com/guides/add-autogenerated-captions-and-use-transcripts}
56
+ */
57
+ defaultAutogeneratedSubtitleLang?: SupportedMuxLanguage
58
+
51
59
  /**
52
60
  * Whether or not to allow content editors to override asset upload
53
61
  * configuration settings when uploading a video to Mux.