sanity-plugin-mux-input 2.4.1 → 2.6.0

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 CHANGED
@@ -77,19 +77,19 @@ The Mux plugin will find its access tokens by fetching this document.
77
77
 
78
78
  When a Mux video is uploaded/chosen in a document via this plugin, it gets stored as a reference to the video document:
79
79
 
80
- ```json
80
+ ```json5
81
81
  // example document
82
82
  {
83
- "_type": "exampleSchemaWithVideo",
83
+ _type: 'exampleSchemaWithVideo',
84
84
  // Example video field
85
- "myVideoField": {
86
- "_type": "mux.video",
87
- "asset": {
88
- "_type": "reference",
89
- "_weak": true,
90
- "_ref": "4e37284e-cec2-406d-973c-fdf9ab1e5598" // 👈 ID of the document holding the video's Mux data
91
- }
92
- }
85
+ myVideoField: {
86
+ _type: 'mux.video',
87
+ asset: {
88
+ _type: 'reference',
89
+ _weak: true,
90
+ _ref: '4e37284e-cec2-406d-973c-fdf9ab1e5598', // 👈 ID of the document holding the video's Mux data
91
+ },
92
+ },
93
93
  }
94
94
  ```
95
95
 
@@ -112,54 +112,55 @@ Before you can display videos in your frontend, you need to follow these referen
112
112
 
113
113
  For reference, here's an example `mux.videoAsset` document:
114
114
 
115
- ```json
115
+ ```json5
116
116
  {
117
- "_id": "4e37284e-cec2-406d-973c-fdf9ab1e5598",
118
- "_type": "mux.videoAsset",
119
- "assetId": "7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY",
120
- "filename": "mux-example-video.mp4",
121
- "status": "ready",
122
- "playbackId": "YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA",
117
+ _id: '4e37284e-cec2-406d-973c-fdf9ab1e5598',
118
+ _type: 'mux.videoAsset',
119
+ assetId: '7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY',
120
+ filename: 'mux-example-video.mp4',
121
+ status: 'ready',
122
+ playbackId: 'YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA',
123
+ thumbTime: 65.82,
123
124
  // Full Mux asset data:
124
- "data": {
125
- "encoding_tier": "smart",
126
- "max_resolution_tier": "1080p",
127
- "aspect_ratio": "16:9",
128
- "created_at": "1706645034",
129
- "duration": 25.492133,
130
- "status": "ready",
131
- "master_access": "none",
132
- "max_stored_frame_rate": 29.97,
133
- "playback_ids": [
125
+ data: {
126
+ encoding_tier: 'smart',
127
+ max_resolution_tier: '1080p',
128
+ aspect_ratio: '16:9',
129
+ created_at: '1706645034',
130
+ duration: 25.492133,
131
+ status: 'ready',
132
+ master_access: 'none',
133
+ max_stored_frame_rate: 29.97,
134
+ playback_ids: [
134
135
  {
135
- "id": "YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA",
136
- "policy": "signed"
137
- }
136
+ id: 'YA02HBpY02fKWHDRMNilo301pdH02LY3k9HTcK43ItGJLWA',
137
+ policy: 'signed',
138
+ },
138
139
  ],
139
- "resolution_tier": "1080p",
140
- "ingest_type": "on_demand_url",
141
- "max_stored_resolution": "HD",
142
- "tracks": [
140
+ resolution_tier: '1080p',
141
+ ingest_type: 'on_demand_url',
142
+ max_stored_resolution: 'HD',
143
+ tracks: [
143
144
  {
144
- "max_channel_layout": "stereo",
145
- "max_channels": 2,
146
- "id": "00MKMC73SYimw1YTh0102lPJJp9w2R5rHddpNX1N9opAMk",
147
- "type": "audio",
148
- "primary": true,
149
- "duration": 25.45
145
+ max_channel_layout: 'stereo',
146
+ max_channels: 2,
147
+ id: '00MKMC73SYimw1YTh0102lPJJp9w2R5rHddpNX1N9opAMk',
148
+ type: 'audio',
149
+ primary: true,
150
+ duration: 25.45,
150
151
  },
151
152
  {
152
- "max_frame_rate": 29.97,
153
- "max_height": 1080,
154
- "id": "g1wEph3CVvbJL01YNKzAWMyH8N1SxW00WeECGjqwEHW9g",
155
- "type": "video",
156
- "duration": 25.4254,
157
- "max_width": 1920
158
- }
153
+ max_frame_rate: 29.97,
154
+ max_height: 1080,
155
+ id: 'g1wEph3CVvbJL01YNKzAWMyH8N1SxW00WeECGjqwEHW9g',
156
+ type: 'video',
157
+ duration: 25.4254,
158
+ max_width: 1920,
159
+ },
159
160
  ],
160
- "id": "7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY",
161
- "mp4_support": "none"
162
- }
161
+ id: '7ovyI76F92n02H00mWP7lOCZMIU00N4iysDiQDNppX026HY',
162
+ mp4_support: 'none',
163
+ },
163
164
  }
164
165
  ```
165
166
 
@@ -187,6 +188,8 @@ export default function MuxVideo({playbackId, title}: {playbackId?: string; titl
187
188
 
188
189
  To enable [signed URLs](https://docs.mux.com/docs/security-signed-urls) with content uploaded to Mux, you will need to check the "Enable Signed Urls" option in the Mux Plugin configuration. This feature requires you to set the API Access Token and Secret Key (as per the [Quick start](#quick-start) section).
189
190
 
191
+ ⚠️ **Important:** To use Signed URLs, the API Access Token must have **System permissions**. Without these permissions, the signing key cannot be created, and authentication will fail.
192
+
190
193
  📌 **Note**: When the signed URL option is triggered, the plugin will cache a `signingKeyPrivate` in a private document in the dataset. This key is used by Mux to sign the uploads, and if it's incorrect your uploads will fail. If that's the case, you can delete the secrets document and try again:
191
194
 
192
195
  ```bash
@@ -279,7 +282,7 @@ Issues are actively monitored and PRs are welcome. When developing this plugin t
279
282
 
280
283
  ### Publishing
281
284
 
282
- Run the ["CI" workflow](https://github.com/sanity-io/sanity-plugin-mux-input/actions/workflows/ci.yml).
285
+ You can run the ["CI and Release" workflow](<[https://github.com/sanity-io/sanity-plugin-mux-input/actions/workflows/ci.yml](https://github.com/sanity-io/sanity-plugin-mux-input/actions/workflows/main.yml)>).
283
286
  Make sure to select the main branch and check "Release new version".
284
287
 
285
288
  Semantic release will only release on configured branches, so it is safe to run release on any branch.
@@ -301,11 +304,12 @@ After Studio v3 turns stable this behavior will change. The v2 version will then
301
304
 
302
305
  ### Develop & test
303
306
 
304
- This plugin uses [@sanity/plugin-kit](https://github.com/sanity-io/plugin-kit)
305
- with default configuration for build & watch scripts.
307
+ You can run the example locally by doing the following:
306
308
 
307
- See [Testing a plugin in Sanity Studio](https://github.com/sanity-io/plugin-kit#testing-a-plugin-in-sanity-studio)
308
- on how to run this plugin with hotreload in the studio.
309
+ 1. run `npm install` and `npm dev` on the root of the repo
310
+ 2. In the terminal, a command with `yalc` will be shown, that command will allow you to run the version that you have locally directly on the example or on your own app.
311
+ 3. run `npm install` and `npm dev` on the `/example` directory where the app with the example exists or in your own app
312
+ 4. the studio and app should auto reload with your changes in the plugin package you have locally
309
313
 
310
314
  ### Release new version
311
315