@gradio/video 0.15.1 → 0.16.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 +18 -0
- package/Index.svelte +1 -1
- package/dist/Index.svelte.d.ts +3 -3
- package/dist/shared/InteractiveVideo.svelte.d.ts +1 -1
- package/dist/shared/Video.svelte +1 -14
- package/dist/shared/VideoPreview.svelte +2 -2
- package/package.json +6 -7
- package/shared/Video.svelte +1 -25
- package/shared/VideoPreview.svelte +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @gradio/video
|
|
2
2
|
|
|
3
|
+
## 0.16.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- [#11858](https://github.com/gradio-app/gradio/pull/11858) [`3f8ea13`](https://github.com/gradio-app/gradio/commit/3f8ea13a8ca92abf0ad34392e403a449fda3c6c2) - remove lite. Thanks @pngwn!
|
|
8
|
+
|
|
9
|
+
### Fixes
|
|
10
|
+
|
|
11
|
+
- [#11784](https://github.com/gradio-app/gradio/pull/11784) [`d9dd3f5`](https://github.com/gradio-app/gradio/commit/d9dd3f54b7fb34cf7118e549d39fc63937ca3489) - Add "hidden" option to component's `visible` kwarg to render but visually hide the component. Thanks @pngwn!
|
|
12
|
+
|
|
13
|
+
### Dependency updates
|
|
14
|
+
|
|
15
|
+
- @gradio/statustracker@0.11.1
|
|
16
|
+
- @gradio/atoms@0.18.0
|
|
17
|
+
- @gradio/client@1.19.0
|
|
18
|
+
- @gradio/upload@0.17.0
|
|
19
|
+
- @gradio/image@0.23.0
|
|
20
|
+
|
|
3
21
|
## 0.15.1
|
|
4
22
|
|
|
5
23
|
### Dependency updates
|
package/Index.svelte
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { WebcamOptions } from "./shared/utils";
|
|
13
13
|
export let elem_id = "";
|
|
14
14
|
export let elem_classes: string[] = [];
|
|
15
|
-
export let visible = true;
|
|
15
|
+
export let visible: boolean | "hidden" = true;
|
|
16
16
|
export let value: { video: FileData; subtitles: FileData | null } | null =
|
|
17
17
|
null;
|
|
18
18
|
let old_value: { video: FileData; subtitles: FileData | null } | null = null;
|
package/dist/Index.svelte.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare const __propDef: {
|
|
|
7
7
|
props: {
|
|
8
8
|
elem_id?: string;
|
|
9
9
|
elem_classes?: string[];
|
|
10
|
-
visible?: boolean;
|
|
10
|
+
visible?: boolean | "hidden";
|
|
11
11
|
value?: {
|
|
12
12
|
video: FileData;
|
|
13
13
|
subtitles: FileData | null;
|
|
@@ -63,9 +63,9 @@ export default class Index extends SvelteComponent<IndexProps, IndexEvents, Inde
|
|
|
63
63
|
get elem_classes(): string[] | undefined;
|
|
64
64
|
/**accessor*/
|
|
65
65
|
set elem_classes(_: string[] | undefined);
|
|
66
|
-
get visible(): boolean | undefined;
|
|
66
|
+
get visible(): boolean | "hidden" | undefined;
|
|
67
67
|
/**accessor*/
|
|
68
|
-
set visible(_: boolean | undefined);
|
|
68
|
+
set visible(_: boolean | "hidden" | undefined);
|
|
69
69
|
get value(): {
|
|
70
70
|
video: FileData;
|
|
71
71
|
subtitles: FileData | null;
|
|
@@ -31,7 +31,7 @@ declare const __propDef: {
|
|
|
31
31
|
pause: CustomEvent<any>;
|
|
32
32
|
stop: CustomEvent<undefined>;
|
|
33
33
|
end: CustomEvent<any>;
|
|
34
|
-
change: CustomEvent<
|
|
34
|
+
change: CustomEvent<any>;
|
|
35
35
|
clear?: CustomEvent<undefined> | undefined;
|
|
36
36
|
drag: CustomEvent<boolean>;
|
|
37
37
|
upload: CustomEvent<FileData>;
|
package/dist/shared/Video.svelte
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>import { createEventDispatcher } from "svelte";
|
|
2
2
|
import { loaded } from "./utils";
|
|
3
|
-
import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
4
3
|
import Hls from "hls.js";
|
|
5
4
|
export let src = void 0;
|
|
6
5
|
export let muted = void 0;
|
|
@@ -15,19 +14,7 @@ export let node = void 0;
|
|
|
15
14
|
export let loop;
|
|
16
15
|
export let is_stream;
|
|
17
16
|
export let processingVideo = false;
|
|
18
|
-
let resolved_src;
|
|
19
17
|
let stream_active = false;
|
|
20
|
-
let latest_src;
|
|
21
|
-
$: {
|
|
22
|
-
resolved_src = src;
|
|
23
|
-
latest_src = src;
|
|
24
|
-
const resolving_src = src;
|
|
25
|
-
resolve_wasm_src(resolving_src).then((s) => {
|
|
26
|
-
if (latest_src === resolving_src) {
|
|
27
|
-
resolved_src = s;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
18
|
const dispatch = createEventDispatcher();
|
|
32
19
|
function load_stream(src2, is_stream2, node2) {
|
|
33
20
|
if (!src2 || !is_stream2) return;
|
|
@@ -88,7 +75,7 @@ Then, even when `controls` is false, the compiled DOM would be `<video controls=
|
|
|
88
75
|
</span>
|
|
89
76
|
</div>
|
|
90
77
|
<video
|
|
91
|
-
src
|
|
78
|
+
{src}
|
|
92
79
|
{muted}
|
|
93
80
|
{playsinline}
|
|
94
81
|
{preload}
|
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
Empty,
|
|
5
5
|
IconButton,
|
|
6
6
|
ShareButton,
|
|
7
|
-
IconButtonWrapper
|
|
7
|
+
IconButtonWrapper,
|
|
8
|
+
DownloadLink
|
|
8
9
|
} from "@gradio/atoms";
|
|
9
10
|
import { Video, Download } from "@gradio/icons";
|
|
10
11
|
import { uploadToHuggingFace } from "@gradio/utils";
|
|
11
|
-
import { DownloadLink } from "@gradio/wasm/svelte";
|
|
12
12
|
import Player from "./Player.svelte";
|
|
13
13
|
export let value = null;
|
|
14
14
|
export let subtitle = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/video",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.16.0",
|
|
4
4
|
"description": "Gradio UI packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "",
|
|
@@ -11,14 +11,13 @@
|
|
|
11
11
|
"@ffmpeg/util": "^0.12.1",
|
|
12
12
|
"hls.js": "^1.5.13",
|
|
13
13
|
"mrmime": "^2.0.0",
|
|
14
|
+
"@gradio/atoms": "^0.18.0",
|
|
14
15
|
"@gradio/icons": "^0.14.0",
|
|
15
|
-
"@gradio/client": "^1.
|
|
16
|
-
"@gradio/
|
|
17
|
-
"@gradio/image": "^0.
|
|
18
|
-
"@gradio/atoms": "^0.17.0",
|
|
19
|
-
"@gradio/upload": "^0.16.17",
|
|
16
|
+
"@gradio/client": "^1.19.0",
|
|
17
|
+
"@gradio/upload": "^0.17.0",
|
|
18
|
+
"@gradio/image": "^0.23.0",
|
|
20
19
|
"@gradio/utils": "^0.10.2",
|
|
21
|
-
"@gradio/
|
|
20
|
+
"@gradio/statustracker": "^0.11.1"
|
|
22
21
|
},
|
|
23
22
|
"devDependencies": {
|
|
24
23
|
"@gradio/preview": "^0.14.0"
|
package/shared/Video.svelte
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
import { createEventDispatcher } from "svelte";
|
|
4
4
|
import { loaded } from "./utils";
|
|
5
5
|
|
|
6
|
-
import { resolve_wasm_src } from "@gradio/wasm/svelte";
|
|
7
|
-
|
|
8
6
|
import Hls from "hls.js";
|
|
9
7
|
|
|
10
8
|
export let src: HTMLVideoAttributes["src"] = undefined;
|
|
@@ -25,30 +23,8 @@
|
|
|
25
23
|
|
|
26
24
|
export let processingVideo = false;
|
|
27
25
|
|
|
28
|
-
let resolved_src: typeof src;
|
|
29
26
|
let stream_active = false;
|
|
30
27
|
|
|
31
|
-
// The `src` prop can be updated before the Promise from `resolve_wasm_src` is resolved.
|
|
32
|
-
// In such a case, the resolved value for the old `src` has to be discarded,
|
|
33
|
-
// This variable `latest_src` is used to pick up only the value resolved for the latest `src` prop.
|
|
34
|
-
let latest_src: typeof src;
|
|
35
|
-
$: {
|
|
36
|
-
// In normal (non-Wasm) Gradio, the `<img>` element should be rendered with the passed `src` props immediately
|
|
37
|
-
// without waiting for `resolve_wasm_src()` to resolve.
|
|
38
|
-
// If it waits, a blank element is displayed until the async task finishes
|
|
39
|
-
// and it leads to undesirable flickering.
|
|
40
|
-
// So set `src` to `resolved_src` here.
|
|
41
|
-
resolved_src = src;
|
|
42
|
-
|
|
43
|
-
latest_src = src;
|
|
44
|
-
const resolving_src = src;
|
|
45
|
-
resolve_wasm_src(resolving_src).then((s) => {
|
|
46
|
-
if (latest_src === resolving_src) {
|
|
47
|
-
resolved_src = s;
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
28
|
const dispatch = createEventDispatcher();
|
|
53
29
|
|
|
54
30
|
function load_stream(
|
|
@@ -114,7 +90,7 @@ Then, even when `controls` is false, the compiled DOM would be `<video controls=
|
|
|
114
90
|
</span>
|
|
115
91
|
</div>
|
|
116
92
|
<video
|
|
117
|
-
src
|
|
93
|
+
{src}
|
|
118
94
|
{muted}
|
|
119
95
|
{playsinline}
|
|
120
96
|
{preload}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
Empty,
|
|
6
6
|
IconButton,
|
|
7
7
|
ShareButton,
|
|
8
|
-
IconButtonWrapper
|
|
8
|
+
IconButtonWrapper,
|
|
9
|
+
DownloadLink
|
|
9
10
|
} from "@gradio/atoms";
|
|
10
11
|
import type { FileData, Client } from "@gradio/client";
|
|
11
12
|
import { Video, Download } from "@gradio/icons";
|
|
12
13
|
import { uploadToHuggingFace } from "@gradio/utils";
|
|
13
|
-
import { DownloadLink } from "@gradio/wasm/svelte";
|
|
14
14
|
|
|
15
15
|
import Player from "./Player.svelte";
|
|
16
16
|
import type { I18nFormatter } from "js/core/src/gradio_helper";
|