@gradio/video 0.5.1 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @gradio/video
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Features
6
+
7
+ - [#7183](https://github.com/gradio-app/gradio/pull/7183) [`49d9c48`](https://github.com/gradio-app/gradio/commit/49d9c48537aa706bf72628e3640389470138bdc6) - [WIP] Refactor file normalization to be in the backend and remove it from the frontend of each component. Thanks [@abidlabs](https://github.com/abidlabs)!
8
+
3
9
  ## 0.5.1
4
10
 
5
11
  ### Features
package/Index.svelte CHANGED
@@ -3,7 +3,7 @@
3
3
  <script lang="ts">
4
4
  import type { Gradio, ShareData } from "@gradio/utils";
5
5
 
6
- import { normalise_file, type FileData } from "@gradio/client";
6
+ import type { FileData } from "@gradio/client";
7
7
  import { Block, UploadText } from "@gradio/atoms";
8
8
  import StaticVideo from "./shared/VideoPreview.svelte";
9
9
  import Video from "./shared/InteractiveVideo.svelte";
@@ -24,7 +24,6 @@
24
24
  | ["webcam", "upload"]
25
25
  | ["upload", "webcam"];
26
26
  export let root: string;
27
- export let proxy_url: null | string;
28
27
  export let show_label: boolean;
29
28
  export let loading_status: LoadingStatus;
30
29
  export let height: number | undefined;
@@ -80,8 +79,8 @@
80
79
 
81
80
  $: {
82
81
  if (value != null) {
83
- _video = normalise_file(value.video, root, proxy_url);
84
- _subtitle = normalise_file(value.subtitles, root, proxy_url);
82
+ _video = value.video;
83
+ _subtitle = value.subtitles;
85
84
  } else {
86
85
  _video = null;
87
86
  _subtitle = null;
package/Video.test.ts CHANGED
@@ -41,8 +41,10 @@ describe("Video", () => {
41
41
  loading_status,
42
42
  value: {
43
43
  video: {
44
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
45
- }
44
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
45
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
46
+ },
47
+ subtitles: null
46
48
  },
47
49
  label: "Test Label",
48
50
  root: "foo",
@@ -56,7 +58,7 @@ describe("Video", () => {
56
58
  let vid = getByTestId("Test Label-player") as HTMLVideoElement;
57
59
  assert.equal(
58
60
  vid.src,
59
- "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
61
+ "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
60
62
  );
61
63
  assert.equal(queryAllByText("Test Label").length, 1);
62
64
  });
@@ -67,8 +69,10 @@ describe("Video", () => {
67
69
  loading_status,
68
70
  value: {
69
71
  video: {
70
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
71
- }
72
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
73
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
74
+ },
75
+ subtitles: null
72
76
  },
73
77
  label: "Video Component",
74
78
  root: "foo",
@@ -88,8 +92,10 @@ describe("Video", () => {
88
92
  loading_status,
89
93
  value: {
90
94
  video: {
91
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
92
- }
95
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
96
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
97
+ },
98
+ subtitles: null
93
99
  },
94
100
  root: "foo",
95
101
  proxy_url: null,
@@ -102,7 +108,7 @@ describe("Video", () => {
102
108
  let vid = getByTestId("test-player") as HTMLVideoElement;
103
109
  assert.equal(
104
110
  vid.src,
105
- "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
111
+ "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
106
112
  );
107
113
  });
108
114
 
@@ -113,8 +119,10 @@ describe("Video", () => {
113
119
  interactive: false,
114
120
  value: {
115
121
  video: {
116
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
117
- }
122
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
123
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
124
+ },
125
+ subtitles: null
118
126
  },
119
127
  root: "foo",
120
128
  proxy_url: null,
@@ -135,8 +143,10 @@ describe("Video", () => {
135
143
  loading_status,
136
144
  value: {
137
145
  video: {
138
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
139
- }
146
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
147
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
148
+ },
149
+ subtitles: null
140
150
  },
141
151
  root: "foo",
142
152
  proxy_url: null,
@@ -158,8 +168,10 @@ describe("Video", () => {
158
168
  interactive: false,
159
169
  value: {
160
170
  video: {
161
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
162
- }
171
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
172
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
173
+ },
174
+ subtitles: null
163
175
  },
164
176
  root: "foo",
165
177
  proxy_url: null,
@@ -189,8 +201,10 @@ describe("Video", () => {
189
201
  interactive: true,
190
202
  value: {
191
203
  video: {
192
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
193
- }
204
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
205
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
206
+ },
207
+ subtitles: null
194
208
  },
195
209
  root: "foo",
196
210
  proxy_url: null,
@@ -205,8 +219,10 @@ describe("Video", () => {
205
219
  component.$set({
206
220
  value: {
207
221
  video: {
208
- path: "https://gradio-builds.s3.amazonaws.com/demo-files/audio_sample.wav"
209
- }
222
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
223
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
224
+ },
225
+ subtitles: null
210
226
  }
211
227
  });
212
228
  startButton.dispatchEvent(new Event("loadeddata"));
@@ -215,10 +231,8 @@ describe("Video", () => {
215
231
  test("renders video and download button", async () => {
216
232
  const data = {
217
233
  video: {
218
- path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
219
- },
220
- subtitles: {
221
- path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
234
+ path: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4",
235
+ url: "https://raw.githubusercontent.com/gradio-app/gradio/main/gradio/demo/video_component/files/a.mp4"
222
236
  }
223
237
  };
224
238
  const results = await render(Video, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -10,14 +10,14 @@
10
10
  "@ffmpeg/ffmpeg": "^0.12.7",
11
11
  "@ffmpeg/util": "^0.12.1",
12
12
  "mrmime": "^2.0.0",
13
- "@gradio/client": "^0.11.0",
13
+ "@gradio/atoms": "^0.5.1",
14
+ "@gradio/client": "^0.12.0",
14
15
  "@gradio/icons": "^0.3.2",
15
- "@gradio/image": "^0.8.0",
16
16
  "@gradio/statustracker": "^0.4.5",
17
- "@gradio/upload": "^0.7.1",
17
+ "@gradio/image": "^0.9.0",
18
+ "@gradio/upload": "^0.7.2",
18
19
  "@gradio/utils": "^0.2.2",
19
- "@gradio/wasm": "^0.6.0",
20
- "@gradio/atoms": "^0.5.1"
20
+ "@gradio/wasm": "^0.6.0"
21
21
  },
22
22
  "exports": {
23
23
  ".": "./index.ts",