@gradio/video 0.1.0 → 0.1.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/CHANGELOG.md CHANGED
@@ -1,37 +1,52 @@
1
1
  # @gradio/video
2
2
 
3
+ ## 0.1.2
4
+
5
+ ### Fixes
6
+
7
+ - [#6234](https://github.com/gradio-app/gradio/pull/6234) [`aaa55ce85`](https://github.com/gradio-app/gradio/commit/aaa55ce85e12f95aba9299445e9c5e59824da18e) - Video/Audio fixes. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
8
+
9
+ ## 0.1.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [[`2ba14b284`](https://github.com/gradio-app/gradio/commit/2ba14b284f908aa13859f4337167a157075a68eb)]:
14
+ - @gradio/client@0.7.1
15
+ - @gradio/image@0.3.1
16
+ - @gradio/upload@0.3.1
17
+
3
18
  ## 0.1.0
4
19
 
5
20
  ### Features
6
21
 
7
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - fix circular dependency with client + upload. Thanks [@pngwn](https://github.com/pngwn)!
8
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Clean root url. Thanks [@pngwn](https://github.com/pngwn)!
9
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Improve Video Component. Thanks [@pngwn](https://github.com/pngwn)!
10
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Image v4. Thanks [@pngwn](https://github.com/pngwn)!
11
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Publish all components to npm. Thanks [@pngwn](https://github.com/pngwn)!
12
- - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Custom components. Thanks [@pngwn](https://github.com/pngwn)!
22
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - fix circular dependency with client + upload. Thanks [@pngwn](https://github.com/pngwn)!
23
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Clean root url. Thanks [@pngwn](https://github.com/pngwn)!
24
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Improve Video Component. Thanks [@pngwn](https://github.com/pngwn)!
25
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Image v4. Thanks [@pngwn](https://github.com/pngwn)!
26
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Publish all components to npm. Thanks [@pngwn](https://github.com/pngwn)!
27
+ - [#5498](https://github.com/gradio-app/gradio/pull/5498) [`287fe6782`](https://github.com/gradio-app/gradio/commit/287fe6782825479513e79a5cf0ba0fbfe51443d7) - Custom components. Thanks [@pngwn](https://github.com/pngwn)!
13
28
 
14
29
  ## 0.1.0-beta.9
15
30
 
16
31
  ### Features
17
32
 
18
- - [#6143](https://github.com/gradio-app/gradio/pull/6143) [`e4f7b4b40`](https://github.com/gradio-app/gradio/commit/e4f7b4b409323b01aa01b39e15ce6139e29aa073) - fix circular dependency with client + upload. Thanks [@pngwn](https://github.com/pngwn)!
19
- - [#6136](https://github.com/gradio-app/gradio/pull/6136) [`667802a6c`](https://github.com/gradio-app/gradio/commit/667802a6cdbfb2ce454a3be5a78e0990b194548a) - JS Component Documentation. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
20
- - [#6094](https://github.com/gradio-app/gradio/pull/6094) [`c476bd5a5`](https://github.com/gradio-app/gradio/commit/c476bd5a5b70836163b9c69bf4bfe068b17fbe13) - Image v4. Thanks [@pngwn](https://github.com/pngwn)!
21
- - [#6149](https://github.com/gradio-app/gradio/pull/6149) [`90318b1dd`](https://github.com/gradio-app/gradio/commit/90318b1dd118ae08a695a50e7c556226234ab6dc) - swap `mode` on the frontned to `interactive` to match the backend. Thanks [@pngwn](https://github.com/pngwn)!
22
- - [#6118](https://github.com/gradio-app/gradio/pull/6118) [`88bccfdba`](https://github.com/gradio-app/gradio/commit/88bccfdba3df2df4b2747ea5d649ed528047cf50) - Improve Video Component. Thanks [@hannahblair](https://github.com/hannahblair)!
23
- - [#6140](https://github.com/gradio-app/gradio/pull/6140) [`71bf2702c`](https://github.com/gradio-app/gradio/commit/71bf2702cd5b810c89e2e53452532650acdcfb87) - Fix video. Thanks [@abidlabs](https://github.com/abidlabs)!
33
+ - [#6143](https://github.com/gradio-app/gradio/pull/6143) [`e4f7b4b40`](https://github.com/gradio-app/gradio/commit/e4f7b4b409323b01aa01b39e15ce6139e29aa073) - fix circular dependency with client + upload. Thanks [@pngwn](https://github.com/pngwn)!
34
+ - [#6136](https://github.com/gradio-app/gradio/pull/6136) [`667802a6c`](https://github.com/gradio-app/gradio/commit/667802a6cdbfb2ce454a3be5a78e0990b194548a) - JS Component Documentation. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
35
+ - [#6094](https://github.com/gradio-app/gradio/pull/6094) [`c476bd5a5`](https://github.com/gradio-app/gradio/commit/c476bd5a5b70836163b9c69bf4bfe068b17fbe13) - Image v4. Thanks [@pngwn](https://github.com/pngwn)!
36
+ - [#6149](https://github.com/gradio-app/gradio/pull/6149) [`90318b1dd`](https://github.com/gradio-app/gradio/commit/90318b1dd118ae08a695a50e7c556226234ab6dc) - swap `mode` on the frontned to `interactive` to match the backend. Thanks [@pngwn](https://github.com/pngwn)!
37
+ - [#6118](https://github.com/gradio-app/gradio/pull/6118) [`88bccfdba`](https://github.com/gradio-app/gradio/commit/88bccfdba3df2df4b2747ea5d649ed528047cf50) - Improve Video Component. Thanks [@hannahblair](https://github.com/hannahblair)!
38
+ - [#6140](https://github.com/gradio-app/gradio/pull/6140) [`71bf2702c`](https://github.com/gradio-app/gradio/commit/71bf2702cd5b810c89e2e53452532650acdcfb87) - Fix video. Thanks [@abidlabs](https://github.com/abidlabs)!
24
39
 
25
40
  ## 0.1.0-beta.8
26
41
 
27
42
  ### Features
28
43
 
29
- - [#6016](https://github.com/gradio-app/gradio/pull/6016) [`83e947676`](https://github.com/gradio-app/gradio/commit/83e947676d327ca2ab6ae2a2d710c78961c771a0) - Format js in v4 branch. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
44
+ - [#6016](https://github.com/gradio-app/gradio/pull/6016) [`83e947676`](https://github.com/gradio-app/gradio/commit/83e947676d327ca2ab6ae2a2d710c78961c771a0) - Format js in v4 branch. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
30
45
 
31
46
  ### Fixes
32
47
 
33
- - [#6067](https://github.com/gradio-app/gradio/pull/6067) [`bf38e5f06`](https://github.com/gradio-app/gradio/commit/bf38e5f06a7039be913614901c308794fea83ae0) - remove dupe component. Thanks [@pngwn](https://github.com/pngwn)!
34
- - [#6046](https://github.com/gradio-app/gradio/pull/6046) [`dbb7de5e0`](https://github.com/gradio-app/gradio/commit/dbb7de5e02c53fee05889d696d764d212cb96c74) - fix tests. Thanks [@pngwn](https://github.com/pngwn)!
48
+ - [#6067](https://github.com/gradio-app/gradio/pull/6067) [`bf38e5f06`](https://github.com/gradio-app/gradio/commit/bf38e5f06a7039be913614901c308794fea83ae0) - remove dupe component. Thanks [@pngwn](https://github.com/pngwn)!
49
+ - [#6046](https://github.com/gradio-app/gradio/pull/6046) [`dbb7de5e0`](https://github.com/gradio-app/gradio/commit/dbb7de5e02c53fee05889d696d764d212cb96c74) - fix tests. Thanks [@pngwn](https://github.com/pngwn)!
35
50
 
36
51
  ## 0.1.0-beta.7
37
52
 
package/Index.svelte CHANGED
@@ -47,6 +47,7 @@
47
47
  stop_recording: never;
48
48
  share: ShareData;
49
49
  error: string;
50
+ warning: string;
50
51
  }>;
51
52
  export let interactive: boolean;
52
53
  export let mirror_webcam: boolean;
@@ -109,6 +110,16 @@
109
110
  value = null;
110
111
  }
111
112
  }
113
+
114
+ function handle_error({ detail }: CustomEvent<string>): void {
115
+ const [level, status] = detail.includes("Invalid file type")
116
+ ? ["warning", "complete"]
117
+ : ["error", "error"];
118
+ loading_status = loading_status || {};
119
+ loading_status.status = status as LoadingStatus["status"];
120
+ loading_status.message = detail;
121
+ gradio.dispatch(level as "error" | "warning", detail);
122
+ }
112
123
  </script>
113
124
 
114
125
  {#if !interactive}
@@ -175,11 +186,7 @@
175
186
  subtitle={_subtitle}
176
187
  on:change={handle_change}
177
188
  on:drag={({ detail }) => (dragging = detail)}
178
- on:error={({ detail }) => {
179
- loading_status = loading_status || {};
180
- loading_status.status = "error";
181
- loading_status.message = detail;
182
- }}
189
+ on:error={handle_error}
183
190
  {label}
184
191
  {show_label}
185
192
  {sources}
@@ -27,15 +27,31 @@
27
27
  </Template>
28
28
 
29
29
  <Story
30
- name="Primary"
30
+ name="Record from webcam"
31
31
  args={{
32
- value: ["https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4"],
33
32
  format: "mp4",
34
33
  label: "world video",
35
34
  show_label: true,
36
35
  interactive: true,
37
- autoplay: true,
38
36
  height: 400,
39
37
  width: 400
40
38
  }}
41
39
  />
40
+
41
+ <Story
42
+ name="Static video"
43
+ args={{
44
+ value: {
45
+ video: {
46
+ path: "https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4",
47
+ url: "https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4",
48
+ orig_name: "world.mp4"
49
+ }
50
+ },
51
+ label: "world video",
52
+ show_label: true,
53
+ interactive: false,
54
+ height: 200,
55
+ width: 400
56
+ }}
57
+ />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -8,11 +8,11 @@
8
8
  "private": false,
9
9
  "dependencies": {
10
10
  "@gradio/atoms": "^0.2.0",
11
- "@gradio/client": "^0.7.0",
11
+ "@gradio/client": "^0.7.1",
12
12
  "@gradio/icons": "^0.2.0",
13
- "@gradio/image": "^0.3.0",
13
+ "@gradio/image": "^0.3.2",
14
14
  "@gradio/statustracker": "^0.3.0",
15
- "@gradio/upload": "^0.3.0",
15
+ "@gradio/upload": "^0.3.2",
16
16
  "@gradio/utils": "^0.2.0",
17
17
  "@gradio/wasm": "^0.2.0"
18
18
  },
@@ -48,7 +48,6 @@
48
48
 
49
49
  function handle_clear(): void {
50
50
  value = null;
51
- active_source = sources[0];
52
51
  dispatch("change", null);
53
52
  dispatch("clear");
54
53
  }
@@ -68,6 +67,7 @@
68
67
  bind:dragging
69
68
  filetype="video/x-m4v,video/*"
70
69
  on:load={handle_load}
70
+ on:error={({ detail }) => dispatch("error", detail)}
71
71
  {root}
72
72
  >
73
73
  <slot />
@@ -124,7 +124,7 @@
124
124
  >
125
125
  <button
126
126
  class="icon"
127
- aria-label="Record audio"
127
+ aria-label="Record video"
128
128
  on:click={() => {
129
129
  handle_clear();
130
130
  active_source = "webcam";
@@ -91,7 +91,8 @@
91
91
  position: relative;
92
92
  background-color: var(--border-color-accent-subdued);
93
93
  animation: shadowPulse 2s linear infinite;
94
- box-shadow: -24px 0 var(--border-color-accent-subdued),
94
+ box-shadow:
95
+ -24px 0 var(--border-color-accent-subdued),
95
96
  24px 0 var(--border-color-accent-subdued);
96
97
  margin: var(--spacing-md);
97
98
  border-radius: 50%;
@@ -102,15 +103,21 @@
102
103
 
103
104
  @keyframes shadowPulse {
104
105
  33% {
105
- box-shadow: -24px 0 var(--border-color-accent-subdued), 24px 0 #fff;
106
+ box-shadow:
107
+ -24px 0 var(--border-color-accent-subdued),
108
+ 24px 0 #fff;
106
109
  background: #fff;
107
110
  }
108
111
  66% {
109
- box-shadow: -24px 0 #fff, 24px 0 #fff;
112
+ box-shadow:
113
+ -24px 0 #fff,
114
+ 24px 0 #fff;
110
115
  background: var(--border-color-accent-subdued);
111
116
  }
112
117
  100% {
113
- box-shadow: -24px 0 #fff, 24px 0 var(--border-color-accent-subdued);
118
+ box-shadow:
119
+ -24px 0 #fff,
120
+ 24px 0 var(--border-color-accent-subdued);
114
121
  background: #fff;
115
122
  }
116
123
  }
@@ -202,7 +202,8 @@
202
202
  position: relative;
203
203
  background-color: var(--border-color-accent-subdued);
204
204
  animation: shadowPulse 2s linear infinite;
205
- box-shadow: -24px 0 var(--border-color-accent-subdued),
205
+ box-shadow:
206
+ -24px 0 var(--border-color-accent-subdued),
206
207
  24px 0 var(--border-color-accent-subdued);
207
208
  margin: var(--spacing-md);
208
209
  border-radius: 50%;
@@ -213,15 +214,21 @@
213
214
 
214
215
  @keyframes shadowPulse {
215
216
  33% {
216
- box-shadow: -24px 0 var(--border-color-accent-subdued), 24px 0 #fff;
217
+ box-shadow:
218
+ -24px 0 var(--border-color-accent-subdued),
219
+ 24px 0 #fff;
217
220
  background: #fff;
218
221
  }
219
222
  66% {
220
- box-shadow: -24px 0 #fff, 24px 0 #fff;
223
+ box-shadow:
224
+ -24px 0 #fff,
225
+ 24px 0 #fff;
221
226
  background: var(--border-color-accent-subdued);
222
227
  }
223
228
  100% {
224
- box-shadow: -24px 0 #fff, 24px 0 var(--border-color-accent-subdued);
229
+ box-shadow:
230
+ -24px 0 #fff,
231
+ 24px 0 var(--border-color-accent-subdued);
225
232
  background: #fff;
226
233
  }
227
234
  }