@sanity/client 7.11.1 → 7.11.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 CHANGED
@@ -2295,20 +2295,25 @@ const client = createClient({
2295
2295
  })
2296
2296
 
2297
2297
  // Basic usage with video asset ID
2298
- const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo('video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4')
2298
+ const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo(
2299
+ 'video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4',
2300
+ )
2299
2301
 
2300
2302
  // With transformations
2301
- const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo('video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4', {
2302
- transformations: {
2303
- thumbnail: { width: 300, format: 'webp', fit: 'smartcrop' },
2304
- animated: { width: 200, fps: 15, format: 'webp' }
2303
+ const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo(
2304
+ 'video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4',
2305
+ {
2306
+ transformations: {
2307
+ thumbnail: {width: 300, format: 'webp', fit: 'smartcrop'},
2308
+ animated: {width: 200, fps: 15, format: 'webp'},
2309
+ },
2310
+ expiration: 3600, // seconds
2305
2311
  },
2306
- expiration: 3600 // seconds
2307
- })
2312
+ )
2308
2313
 
2309
2314
  // Using Global Dataset Reference (GDR)
2310
2315
  const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo({
2311
- _ref: 'media-library:mlZxz9rvqf76:30rh9U3GDEK3ToiId1Zje4uvalC'
2316
+ _ref: 'media-library:mlZxz9rvqf76:30rh9U3GDEK3ToiId1Zje4uvalC',
2312
2317
  })
2313
2318
  ```
2314
2319
 
@@ -2329,19 +2334,19 @@ The response contains playback URLs and metadata:
2329
2334
  // Signed playback response (when video requires authentication)
2330
2335
  {
2331
2336
  id: "30rh9U3GDEK3ToiId1Zje4uvalC",
2332
- stream: {
2337
+ stream: {
2333
2338
  url: "https://stream.m.sanity-cdn.com/...",
2334
2339
  token: "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9..."
2335
2340
  },
2336
- thumbnail: {
2341
+ thumbnail: {
2337
2342
  url: "https://image.m.sanity-cdn.com/...",
2338
2343
  token: "eyJ0a2VuIjoiVGh1bWJuYWlsVG9rZW4tMTIz..."
2339
2344
  },
2340
- animated: {
2345
+ animated: {
2341
2346
  url: "https://image.m.sanity-cdn.com/...",
2342
2347
  token: "eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY..."
2343
2348
  },
2344
- storyboard: {
2349
+ storyboard: {
2345
2350
  url: "https://storyboard.m.sanity-cdn.com/...",
2346
2351
  token: "eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4..."
2347
2352
  },
@@ -2355,7 +2360,9 @@ The response contains playback URLs and metadata:
2355
2360
  ```js
2356
2361
  import {getPlaybackTokens, isSignedPlaybackInfo} from '@sanity/client/media-library'
2357
2362
 
2358
- const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo('video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4')
2363
+ const playbackInfo = await client.mediaLibrary.video.getPlaybackInfo(
2364
+ 'video-30rh9U3GDEK3ToiId1Zje4uvalC-mp4',
2365
+ )
2359
2366
 
2360
2367
  // Check if the response requires signed URLs
2361
2368
  if (isSignedPlaybackInfo(playbackInfo)) {
@@ -2368,7 +2375,7 @@ if (isSignedPlaybackInfo(playbackInfo)) {
2368
2375
  // animated: "eyJ0a2VuIjoiQW5pbWF0ZWRUb2tlbi1kZWY...",
2369
2376
  // storyboard: "eyJ0a2VuIjoiU3Rvcnlib2FyZFRva2VuLTc4..."
2370
2377
  // }
2371
-
2378
+
2372
2379
  // Use with Mux Player or other compatible players
2373
2380
  // The tokens authenticate access to the video resources
2374
2381
  }