@gradio/video 0.3.1 → 0.5.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,18 @@
1
1
  # @gradio/video
2
2
 
3
+ ## 0.5.0
4
+
5
+ ### Features
6
+
7
+ - [#7104](https://github.com/gradio-app/gradio/pull/7104) [`bc2cdc1`](https://github.com/gradio-app/gradio/commit/bc2cdc1df95b38025486cf76df4a494b66d98585) - Allow download button for interactive Audio and Video components. Thanks [@hannahblair](https://github.com/hannahblair)!
8
+
9
+ ## 0.4.0
10
+
11
+ ### Fixes
12
+
13
+ - [#6933](https://github.com/gradio-app/gradio/pull/6933) [`9cefd2e`](https://github.com/gradio-app/gradio/commit/9cefd2e90a1d0cc4d3e4e953fc5b9b1a7afb68dd) - Refactor examples so they accept data in the same format as is returned by function, rename `.as_example()` to `.process_example()`. Thanks [@abidlabs](https://github.com/abidlabs)!
14
+ - [#7038](https://github.com/gradio-app/gradio/pull/7038) [`6be3c2c`](https://github.com/gradio-app/gradio/commit/6be3c2c47a616c904c8497d1fbef7a851c54d488) - Fix Chatbot custom component template. Thanks [@freddyaboulton](https://github.com/freddyaboulton)!
15
+
3
16
  ## 0.3.1
4
17
 
5
18
  ### Fixes
package/Example.svelte CHANGED
@@ -1,10 +1,11 @@
1
1
  <script lang="ts">
2
2
  import Video from "./shared/Video.svelte";
3
3
  import { playable } from "./shared/utils";
4
+ import { type FileData } from "@gradio/client";
4
5
 
5
6
  export let type: "gallery" | "table";
6
7
  export let selected = false;
7
- export let value: string;
8
+ export let value: { video: FileData; subtitles: FileData | null } | null;
8
9
  export let samples_dir: string;
9
10
  let video: HTMLVideoElement;
10
11
 
@@ -33,7 +34,7 @@
33
34
  on:loadeddata={init}
34
35
  on:mouseover={video.play.bind(video)}
35
36
  on:mouseout={video.pause.bind(video)}
36
- src={samples_dir + value}
37
+ src={samples_dir + value?.video.path}
37
38
  />
38
39
  </div>
39
40
  {:else}
package/Index.svelte CHANGED
@@ -35,6 +35,7 @@
35
35
  export let min_width: number | undefined = undefined;
36
36
  export let autoplay = false;
37
37
  export let show_share_button = true;
38
+ export let show_download_button: boolean;
38
39
  export let gradio: Gradio<{
39
40
  change: never;
40
41
  clear: never;
@@ -146,7 +147,7 @@
146
147
  {show_label}
147
148
  {autoplay}
148
149
  {show_share_button}
149
- show_download_button={true}
150
+ {show_download_button}
150
151
  on:play={() => gradio.dispatch("play")}
151
152
  on:pause={() => gradio.dispatch("pause")}
152
153
  on:stop={() => gradio.dispatch("stop")}
@@ -185,6 +186,7 @@
185
186
  on:error={handle_error}
186
187
  {label}
187
188
  {show_label}
189
+ {show_download_button}
188
190
  {sources}
189
191
  {active_source}
190
192
  {mirror_webcam}
@@ -38,6 +38,7 @@
38
38
  },
39
39
  label: "world video",
40
40
  show_label: true,
41
+ show_download_button: true,
41
42
  interactive: false,
42
43
  height: 200,
43
44
  width: 400
@@ -55,6 +56,7 @@
55
56
  },
56
57
  label: "world video",
57
58
  show_label: true,
59
+ show_download_button: false,
58
60
  interactive: false,
59
61
  height: 200,
60
62
  width: 400
@@ -74,6 +76,26 @@
74
76
  }}
75
77
  />
76
78
 
79
+ <Story
80
+ name="Upload video with download button"
81
+ args={{
82
+ label: "world video",
83
+ show_label: true,
84
+ interactive: true,
85
+ sources: ["upload", "webcam"],
86
+ show_download_button: true,
87
+ width: 400,
88
+ height: 400,
89
+ value: {
90
+ video: {
91
+ path: "https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4",
92
+ url: "https://gradio-static-files.s3.us-west-2.amazonaws.com/world.mp4",
93
+ orig_name: "world.mp4"
94
+ }
95
+ }
96
+ }}
97
+ />
98
+
77
99
  <Story
78
100
  name="Trim video"
79
101
  args={{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.3.1",
3
+ "version": "0.5.0",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -9,17 +9,15 @@
9
9
  "dependencies": {
10
10
  "@ffmpeg/ffmpeg": "^0.12.7",
11
11
  "@ffmpeg/util": "^0.12.1",
12
- "@gradio/atoms": "^0.4.1",
13
- "@gradio/client": "^0.10.0",
12
+ "mrmime": "^2.0.0",
13
+ "@gradio/atoms": "^0.5.0",
14
+ "@gradio/client": "^0.10.1",
14
15
  "@gradio/icons": "^0.3.2",
15
- "@gradio/statustracker": "^0.4.3",
16
- "@gradio/image": "^0.6.1",
17
- "@gradio/upload": "^0.6.0",
18
- "@gradio/utils": "^0.2.0",
19
- "@gradio/wasm": "^0.5.0"
20
- },
21
- "devDependencies": {
22
- "mrmime": "^2.0.0"
16
+ "@gradio/image": "^0.7.1",
17
+ "@gradio/statustracker": "^0.4.4",
18
+ "@gradio/utils": "^0.2.1",
19
+ "@gradio/wasm": "^0.5.1",
20
+ "@gradio/upload": "^0.7.0"
23
21
  },
24
22
  "exports": {
25
23
  ".": "./index.ts",
@@ -19,6 +19,7 @@
19
19
  | ["webcam", "upload"]
20
20
  | ["upload", "webcam"] = ["webcam", "upload"];
21
21
  export let label: string | undefined = undefined;
22
+ export let show_download_button = false;
22
23
  export let show_label = true;
23
24
  export let mirror_webcam = false;
24
25
  export let include_audio: boolean;
@@ -96,7 +97,11 @@
96
97
  {/if}
97
98
  </div>
98
99
  {:else}
99
- <ModifyUpload {i18n} on:clear={handle_clear} />
100
+ <ModifyUpload
101
+ {i18n}
102
+ on:clear={handle_clear}
103
+ download={show_download_button ? value.url : null}
104
+ />
100
105
  {#if playable()}
101
106
  {#key value?.url}
102
107
  <Player