@gradio/video 0.14.13 → 0.14.15

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,32 @@
1
1
  # @gradio/video
2
2
 
3
+ ## 0.14.15
4
+
5
+ ### Fixes
6
+
7
+ - [#11272](https://github.com/gradio-app/gradio/pull/11272) [`8177b01`](https://github.com/gradio-app/gradio/commit/8177b014e5539aa1011a74856d065dbb17fa0326) - Fix bug where streaming one chunk of audio or video would not play. Thanks @freddyaboulton!
8
+
9
+ ### Dependency updates
10
+
11
+ - @gradio/statustracker@0.10.12
12
+ - @gradio/client@1.15.1
13
+ - @gradio/upload@0.16.6
14
+ - @gradio/image@0.22.7
15
+
16
+ ## 0.14.14
17
+
18
+ ### Fixes
19
+
20
+ - [#11117](https://github.com/gradio-app/gradio/pull/11117) [`9b976b7`](https://github.com/gradio-app/gradio/commit/9b976b750a61368f369bcefaacda6d4fb0975c5f) - Raise UI error if video not playable in the browser. Thanks @freddyaboulton!
21
+
22
+ ### Dependency updates
23
+
24
+ - @gradio/statustracker@0.10.11
25
+ - @gradio/atoms@0.16.1
26
+ - @gradio/client@1.15.0
27
+ - @gradio/upload@0.16.5
28
+ - @gradio/image@0.22.6
29
+
3
30
  ## 0.14.13
4
31
 
5
32
  ### Dependency updates
@@ -87,7 +87,7 @@ $:
87
87
  />
88
88
  {/if}
89
89
  </div>
90
- {:else if playable()}
90
+ {:else if value?.url}
91
91
  {#key value?.url}
92
92
  <Player
93
93
  {upload}
@@ -101,6 +101,7 @@ $:
101
101
  on:pause
102
102
  on:stop
103
103
  on:end
104
+ on:error
104
105
  mirror={webcam_options.mirror && active_source === "webcam"}
105
106
  {label}
106
107
  {handle_change}
@@ -86,6 +86,7 @@ $:
86
86
  on:click={play_pause}
87
87
  on:play
88
88
  on:pause
89
+ on:error
89
90
  on:ended={handle_end}
90
91
  bind:currentTime={time}
91
92
  bind:duration
@@ -24,6 +24,7 @@ declare const __propDef: {
24
24
  events: {
25
25
  play: CustomEvent<any>;
26
26
  pause: CustomEvent<any>;
27
+ error: CustomEvent<any>;
27
28
  loadstart: Event;
28
29
  loadeddata: Event;
29
30
  loadedmetadata: Event;
@@ -32,8 +32,6 @@ const dispatch = createEventDispatcher();
32
32
  function load_stream(src2, is_stream2, node2) {
33
33
  if (!src2 || !is_stream2)
34
34
  return;
35
- if (!node2)
36
- return;
37
35
  if (Hls.isSupported() && !stream_active) {
38
36
  const hls = new Hls({
39
37
  maxBufferLength: 1,
@@ -75,7 +73,9 @@ function load_stream(src2, is_stream2, node2) {
75
73
  $:
76
74
  src, stream_active = false;
77
75
  $:
78
- load_stream(src, is_stream, node);
76
+ if (node && src && is_stream) {
77
+ load_stream(src, is_stream, node);
78
+ }
79
79
  </script>
80
80
 
81
81
  <!--
@@ -107,6 +107,7 @@ Then, even when `controls` is false, the compiled DOM would be `<video controls=
107
107
  on:mouseout={dispatch.bind(null, "mouseout")}
108
108
  on:focus={dispatch.bind(null, "focus")}
109
109
  on:blur={dispatch.bind(null, "blur")}
110
+ on:error={dispatch.bind(null, "error", "Video not playable")}
110
111
  on:loadstart
111
112
  on:loadeddata
112
113
  on:loadedmetadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gradio/video",
3
- "version": "0.14.13",
3
+ "version": "0.14.15",
4
4
  "description": "Gradio UI packages",
5
5
  "type": "module",
6
6
  "author": "",
@@ -11,14 +11,14 @@
11
11
  "@ffmpeg/util": "^0.12.1",
12
12
  "hls.js": "^1.5.13",
13
13
  "mrmime": "^2.0.0",
14
- "@gradio/atoms": "^0.16.0",
15
- "@gradio/icons": "^0.12.0",
16
- "@gradio/statustracker": "^0.10.10",
17
- "@gradio/client": "^1.14.2",
18
- "@gradio/upload": "^0.16.4",
19
- "@gradio/image": "^0.22.5",
14
+ "@gradio/client": "^1.15.1",
15
+ "@gradio/atoms": "^0.16.1",
16
+ "@gradio/image": "^0.22.7",
17
+ "@gradio/statustracker": "^0.10.12",
18
+ "@gradio/upload": "^0.16.6",
19
+ "@gradio/utils": "^0.10.2",
20
20
  "@gradio/wasm": "^0.18.1",
21
- "@gradio/utils": "^0.10.2"
21
+ "@gradio/icons": "^0.12.0"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@gradio/preview": "^0.13.0"
@@ -112,7 +112,7 @@
112
112
  />
113
113
  {/if}
114
114
  </div>
115
- {:else if playable()}
115
+ {:else if value?.url}
116
116
  {#key value?.url}
117
117
  <Player
118
118
  {upload}
@@ -126,6 +126,7 @@
126
126
  on:pause
127
127
  on:stop
128
128
  on:end
129
+ on:error
129
130
  mirror={webcam_options.mirror && active_source === "webcam"}
130
131
  {label}
131
132
  {handle_change}
@@ -113,6 +113,7 @@
113
113
  on:click={play_pause}
114
114
  on:play
115
115
  on:pause
116
+ on:error
116
117
  on:ended={handle_end}
117
118
  bind:currentTime={time}
118
119
  bind:duration
@@ -54,10 +54,10 @@
54
54
  function load_stream(
55
55
  src: string | null | undefined,
56
56
  is_stream: boolean,
57
- node: HTMLVideoElement | undefined
57
+ node: HTMLVideoElement
58
58
  ): void {
59
59
  if (!src || !is_stream) return;
60
- if (!node) return;
60
+
61
61
  if (Hls.isSupported() && !stream_active) {
62
62
  const hls = new Hls({
63
63
  maxBufferLength: 1, // 0.5 seconds (500 ms)
@@ -96,7 +96,9 @@
96
96
 
97
97
  $: src, (stream_active = false);
98
98
 
99
- $: load_stream(src, is_stream, node);
99
+ $: if (node && src && is_stream) {
100
+ load_stream(src, is_stream, node);
101
+ }
100
102
  </script>
101
103
 
102
104
  <!--
@@ -128,6 +130,7 @@ Then, even when `controls` is false, the compiled DOM would be `<video controls=
128
130
  on:mouseout={dispatch.bind(null, "mouseout")}
129
131
  on:focus={dispatch.bind(null, "focus")}
130
132
  on:blur={dispatch.bind(null, "blur")}
133
+ on:error={dispatch.bind(null, "error", "Video not playable")}
131
134
  on:loadstart
132
135
  on:loadeddata
133
136
  on:loadedmetadata