@cliff-studio/sanity-plugin-bunny-input 1.0.2 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cliff-studio/sanity-plugin-bunny-input",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Sanity Studio plugin for uploading videos to Bunny Stream",
5
5
  "license": "MIT",
6
6
  "author": "Cliff Studio",
@@ -27,6 +27,7 @@ export function BunnyInput(props) {
27
27
  pollIntervalRef.current = window.setInterval(async () => {
28
28
  try {
29
29
  const videoData = await getVideo(config, value.videoId)
30
+ console.log('[bunny] getVideo response', JSON.stringify(videoData, null, 2))
30
31
  const status = mapBunnyStatus(videoData.status)
31
32
 
32
33
  if (status === 'ready' || status === 'error') {
@@ -41,6 +42,8 @@ export function BunnyInput(props) {
41
42
  ...value,
42
43
  status,
43
44
  duration: videoData.length,
45
+ videoHeight: videoData.height ?? null,
46
+ videoWidth: videoData.width ?? null,
44
47
  thumbnailUrl: getThumbnailUrl(config.cdnHostname, value.videoId),
45
48
  playbackUrl: getPlaybackUrl(config.cdnHostname, value.videoId),
46
49
  mp4Url: getMp4Url(config.cdnHostname, value.videoId),
package/src/schema.js CHANGED
@@ -28,7 +28,7 @@ export const createBunnyVideoSchema = (config) => {
28
28
  }),
29
29
  defineField({
30
30
  type: 'string',
31
- title: 'Collection Name',
31
+ title: 'Collection name',
32
32
  name: 'collectionName',
33
33
  readOnly: true,
34
34
  }),
@@ -51,6 +51,18 @@ export const createBunnyVideoSchema = (config) => {
51
51
  },
52
52
  readOnly: true,
53
53
  }),
54
+ defineField({
55
+ type: 'number',
56
+ title: 'Video width',
57
+ name: 'videoWidth',
58
+ readOnly: true,
59
+ }),
60
+ defineField({
61
+ type: 'number',
62
+ title: 'Video height',
63
+ name: 'videoHeight',
64
+ readOnly: true,
65
+ }),
54
66
  defineField({
55
67
  type: 'string',
56
68
  title: 'Thumbnail URL',