@gradio/video 0.17.0 → 0.18.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 +13 -0
- package/Index.svelte +2 -0
- package/dist/Index.svelte +2 -0
- package/dist/shared/InteractiveVideo.svelte +2 -0
- package/dist/shared/InteractiveVideo.svelte.d.ts +1 -0
- package/dist/shared/Player.svelte +5 -0
- package/dist/shared/Player.svelte.d.ts +1 -0
- package/dist/shared/VideoPreview.svelte +2 -0
- package/dist/shared/VideoPreview.svelte.d.ts +1 -0
- package/dist/types.d.ts +1 -0
- package/package.json +5 -5
- package/shared/InteractiveVideo.svelte +2 -0
- package/shared/Player.svelte +5 -0
- package/shared/VideoPreview.svelte +2 -0
- package/types.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
# @gradio/video
|
|
2
|
+
|
|
3
|
+
## 0.18.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#12504](https://github.com/gradio-app/gradio/pull/12504) [`4476400`](https://github.com/gradio-app/gradio/commit/44764009dfebecf894298efe80366e42578ea65d) - Add `playback_position` to gr.Audio and gr.Video, which can be updated and read. Thanks @aliabid94!
|
|
8
|
+
|
|
9
|
+
## 0.17.0
|
|
10
|
+
|
|
11
|
+
### Dependency updates
|
|
12
|
+
|
|
13
|
+
- @gradio/utils@0.10.4
|
|
14
|
+
|
|
2
15
|
## 0.17.0
|
|
3
16
|
|
|
4
17
|
### Features
|
package/Index.svelte
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
show_download_button={(gradio.props.buttons || ["download"]).includes(
|
|
105
105
|
"download"
|
|
106
106
|
)}
|
|
107
|
+
bind:playback_position={gradio.props.playback_position}
|
|
107
108
|
on:play={() => gradio.dispatch("play")}
|
|
108
109
|
on:pause={() => gradio.dispatch("pause")}
|
|
109
110
|
on:stop={() => gradio.dispatch("stop")}
|
|
@@ -158,6 +159,7 @@
|
|
|
158
159
|
root={gradio.shared.root}
|
|
159
160
|
loop={gradio.props.loop}
|
|
160
161
|
{handle_reset_value}
|
|
162
|
+
bind:playback_position={gradio.props.playback_position}
|
|
161
163
|
on:clear={() => {
|
|
162
164
|
gradio.props.value = null;
|
|
163
165
|
gradio.dispatch("clear");
|
package/dist/Index.svelte
CHANGED
|
@@ -104,6 +104,7 @@
|
|
|
104
104
|
show_download_button={(gradio.props.buttons || ["download"]).includes(
|
|
105
105
|
"download"
|
|
106
106
|
)}
|
|
107
|
+
bind:playback_position={gradio.props.playback_position}
|
|
107
108
|
on:play={() => gradio.dispatch("play")}
|
|
108
109
|
on:pause={() => gradio.dispatch("pause")}
|
|
109
110
|
on:stop={() => gradio.dispatch("stop")}
|
|
@@ -158,6 +159,7 @@
|
|
|
158
159
|
root={gradio.shared.root}
|
|
159
160
|
loop={gradio.props.loop}
|
|
160
161
|
{handle_reset_value}
|
|
162
|
+
bind:playback_position={gradio.props.playback_position}
|
|
161
163
|
on:clear={() => {
|
|
162
164
|
gradio.props.value = null;
|
|
163
165
|
gradio.dispatch("clear");
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
export let loop: boolean;
|
|
35
35
|
export let uploading = false;
|
|
36
36
|
export let upload_promise: Promise<any> | null = null;
|
|
37
|
+
export let playback_position = 0;
|
|
37
38
|
|
|
38
39
|
let has_change_history = false;
|
|
39
40
|
|
|
@@ -139,6 +140,7 @@
|
|
|
139
140
|
{show_download_button}
|
|
140
141
|
{handle_clear}
|
|
141
142
|
{has_change_history}
|
|
143
|
+
bind:playback_position
|
|
142
144
|
/>
|
|
143
145
|
{/key}
|
|
144
146
|
{:else if value.size}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
export let value: FileData | null = null;
|
|
26
26
|
export let handle_clear: () => void = () => {};
|
|
27
27
|
export let has_change_history = false;
|
|
28
|
+
export let playback_position = 0;
|
|
28
29
|
|
|
29
30
|
const dispatch = createEventDispatcher<{
|
|
30
31
|
play: undefined;
|
|
@@ -100,6 +101,10 @@
|
|
|
100
101
|
|
|
101
102
|
$: time = time || 0;
|
|
102
103
|
$: duration = duration || 0;
|
|
104
|
+
$: playback_position = time;
|
|
105
|
+
$: if (playback_position !== time && video) {
|
|
106
|
+
video.currentTime = playback_position;
|
|
107
|
+
}
|
|
103
108
|
</script>
|
|
104
109
|
|
|
105
110
|
<div class="wrap">
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
export let i18n: I18nFormatter;
|
|
27
27
|
export let upload: Client["upload"];
|
|
28
28
|
export let display_icon_button_wrapper_top_corner = false;
|
|
29
|
+
export let playback_position = 0;
|
|
29
30
|
|
|
30
31
|
let old_value: FileData | null = null;
|
|
31
32
|
let old_subtitle: FileData | null = null;
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
interactive={false}
|
|
85
86
|
{upload}
|
|
86
87
|
{i18n}
|
|
88
|
+
bind:playback_position
|
|
87
89
|
/>
|
|
88
90
|
{/key}
|
|
89
91
|
<div data-testid="download-div">
|
|
@@ -25,6 +25,7 @@ declare const VideoPreview: $$__sveltets_2_IsomorphicComponent<{
|
|
|
25
25
|
i18n: I18nFormatter;
|
|
26
26
|
upload: Client["upload"];
|
|
27
27
|
display_icon_button_wrapper_top_corner?: boolean;
|
|
28
|
+
playback_position?: number;
|
|
28
29
|
}, {
|
|
29
30
|
play: CustomEvent<any>;
|
|
30
31
|
pause: CustomEvent<any>;
|
package/dist/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/video",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -11,16 +11,16 @@
|
|
|
11
11
|
"@ffmpeg/util": "^0.12.2",
|
|
12
12
|
"hls.js": "^1.6.13",
|
|
13
13
|
"mrmime": "^2.0.1",
|
|
14
|
-
"@gradio/client": "^2.0.0",
|
|
15
14
|
"@gradio/icons": "^0.15.0",
|
|
15
|
+
"@gradio/client": "^2.0.0",
|
|
16
16
|
"@gradio/atoms": "^0.19.0",
|
|
17
17
|
"@gradio/image": "^0.24.0",
|
|
18
|
-
"@gradio/
|
|
18
|
+
"@gradio/utils": "^0.10.4",
|
|
19
19
|
"@gradio/upload": "^0.17.2",
|
|
20
|
-
"@gradio/
|
|
20
|
+
"@gradio/statustracker": "^0.12.0"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@gradio/preview": "^0.15.
|
|
23
|
+
"@gradio/preview": "^0.15.1"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
"./package.json": "./package.json",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
export let loop: boolean;
|
|
35
35
|
export let uploading = false;
|
|
36
36
|
export let upload_promise: Promise<any> | null = null;
|
|
37
|
+
export let playback_position = 0;
|
|
37
38
|
|
|
38
39
|
let has_change_history = false;
|
|
39
40
|
|
|
@@ -139,6 +140,7 @@
|
|
|
139
140
|
{show_download_button}
|
|
140
141
|
{handle_clear}
|
|
141
142
|
{has_change_history}
|
|
143
|
+
bind:playback_position
|
|
142
144
|
/>
|
|
143
145
|
{/key}
|
|
144
146
|
{:else if value.size}
|
package/shared/Player.svelte
CHANGED
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
export let value: FileData | null = null;
|
|
26
26
|
export let handle_clear: () => void = () => {};
|
|
27
27
|
export let has_change_history = false;
|
|
28
|
+
export let playback_position = 0;
|
|
28
29
|
|
|
29
30
|
const dispatch = createEventDispatcher<{
|
|
30
31
|
play: undefined;
|
|
@@ -100,6 +101,10 @@
|
|
|
100
101
|
|
|
101
102
|
$: time = time || 0;
|
|
102
103
|
$: duration = duration || 0;
|
|
104
|
+
$: playback_position = time;
|
|
105
|
+
$: if (playback_position !== time && video) {
|
|
106
|
+
video.currentTime = playback_position;
|
|
107
|
+
}
|
|
103
108
|
</script>
|
|
104
109
|
|
|
105
110
|
<div class="wrap">
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
export let i18n: I18nFormatter;
|
|
27
27
|
export let upload: Client["upload"];
|
|
28
28
|
export let display_icon_button_wrapper_top_corner = false;
|
|
29
|
+
export let playback_position = 0;
|
|
29
30
|
|
|
30
31
|
let old_value: FileData | null = null;
|
|
31
32
|
let old_subtitle: FileData | null = null;
|
|
@@ -84,6 +85,7 @@
|
|
|
84
85
|
interactive={false}
|
|
85
86
|
{upload}
|
|
86
87
|
{i18n}
|
|
88
|
+
bind:playback_position
|
|
87
89
|
/>
|
|
88
90
|
{/key}
|
|
89
91
|
<div data-testid="download-div">
|