@gradio/video 0.20.3 → 0.20.5
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 +24 -0
- package/Video.test.ts +21 -24
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @gradio/video
|
|
2
2
|
|
|
3
|
+
## 0.20.5
|
|
4
|
+
|
|
5
|
+
### Dependency updates
|
|
6
|
+
|
|
7
|
+
- @gradio/utils@0.12.1
|
|
8
|
+
- @gradio/statustracker@0.13.0
|
|
9
|
+
- @gradio/image@0.26.0
|
|
10
|
+
|
|
11
|
+
## 0.20.4
|
|
12
|
+
|
|
13
|
+
### Dependency updates
|
|
14
|
+
|
|
15
|
+
- @gradio/statustracker@0.12.5
|
|
16
|
+
- @gradio/utils@0.12.0
|
|
17
|
+
- @gradio/atoms@0.22.2
|
|
18
|
+
- @gradio/upload@0.17.7
|
|
19
|
+
- @gradio/image@0.25.4
|
|
20
|
+
|
|
21
|
+
## 0.20.3
|
|
22
|
+
|
|
23
|
+
### Dependency updates
|
|
24
|
+
|
|
25
|
+
- @gradio/client@2.1.0
|
|
26
|
+
|
|
3
27
|
## 0.20.3
|
|
4
28
|
|
|
5
29
|
### Fixes
|
package/Video.test.ts
CHANGED
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
beforeEach,
|
|
9
9
|
expect
|
|
10
10
|
} from "vitest";
|
|
11
|
-
import {
|
|
12
|
-
import { cleanup, render } from "@self/tootils";
|
|
11
|
+
import { cleanup, render } from "@self/tootils/render";
|
|
13
12
|
import { setupi18n } from "../core/src/i18n";
|
|
14
13
|
|
|
15
14
|
vi.mock("@ffmpeg/ffmpeg", () => ({
|
|
@@ -152,9 +151,9 @@ describe("Video", () => {
|
|
|
152
151
|
}
|
|
153
152
|
});
|
|
154
153
|
const startButton = getByTestId("test-player") as HTMLVideoElement;
|
|
155
|
-
const fn = spyOn(startButton, "play");
|
|
154
|
+
const fn = vi.spyOn(startButton, "play").mockResolvedValue(undefined);
|
|
156
155
|
startButton.dispatchEvent(new Event("loadeddata"));
|
|
157
|
-
assert.equal(fn.
|
|
156
|
+
assert.equal(fn.mock.calls.length, 1);
|
|
158
157
|
});
|
|
159
158
|
|
|
160
159
|
test("when autoplay is true `media.play` should be called in dynamic mode", async () => {
|
|
@@ -176,10 +175,10 @@ describe("Video", () => {
|
|
|
176
175
|
constraints: null
|
|
177
176
|
}
|
|
178
177
|
});
|
|
179
|
-
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
assert.equal(fn.
|
|
178
|
+
|
|
179
|
+
const video_player = getByTestId("test-player") as HTMLVideoElement;
|
|
180
|
+
const fn = vi.spyOn(video_player, "play").mockResolvedValue(undefined);
|
|
181
|
+
assert.equal(fn.mock.calls.length, 1);
|
|
183
182
|
});
|
|
184
183
|
|
|
185
184
|
test("when autoplay is true `media.play` should be called in static mode when the Video data is updated", async () => {
|
|
@@ -202,10 +201,9 @@ describe("Video", () => {
|
|
|
202
201
|
constraints: null
|
|
203
202
|
}
|
|
204
203
|
});
|
|
205
|
-
let
|
|
206
|
-
const fn = spyOn(
|
|
207
|
-
|
|
208
|
-
assert.equal(fn.callCount, 1);
|
|
204
|
+
let video_player = getByTestId("test-player") as HTMLVideoElement;
|
|
205
|
+
const fn = vi.spyOn(video_player, "play").mockResolvedValue(undefined);
|
|
206
|
+
assert.equal(fn.mock.calls.length, 1);
|
|
209
207
|
unmount();
|
|
210
208
|
|
|
211
209
|
const result = await render(Video, {
|
|
@@ -227,10 +225,9 @@ describe("Video", () => {
|
|
|
227
225
|
constraints: null
|
|
228
226
|
}
|
|
229
227
|
});
|
|
230
|
-
|
|
231
|
-
const fn2 = spyOn(
|
|
232
|
-
|
|
233
|
-
assert.equal(fn2.callCount, 1);
|
|
228
|
+
video_player = result.getByTestId("test-player") as HTMLVideoElement;
|
|
229
|
+
const fn2 = vi.spyOn(video_player, "play").mockResolvedValue(undefined);
|
|
230
|
+
assert.equal(fn2.mock.calls.length, 1);
|
|
234
231
|
});
|
|
235
232
|
|
|
236
233
|
test("when autoplay is true `media.play` should be called in dynamic mode when the Video data is updated", async () => {
|
|
@@ -253,10 +250,9 @@ describe("Video", () => {
|
|
|
253
250
|
constraints: null
|
|
254
251
|
}
|
|
255
252
|
});
|
|
256
|
-
let
|
|
257
|
-
const fn = spyOn(
|
|
258
|
-
|
|
259
|
-
assert.equal(fn.callCount, 1);
|
|
253
|
+
let video_player = getByTestId("test-player") as HTMLVideoElement;
|
|
254
|
+
const fn = vi.spyOn(video_player, "play").mockResolvedValue(undefined);
|
|
255
|
+
assert.equal(fn.mock.calls.length, 1);
|
|
260
256
|
unmount();
|
|
261
257
|
|
|
262
258
|
const result = await render(Video, {
|
|
@@ -278,10 +274,11 @@ describe("Video", () => {
|
|
|
278
274
|
constraints: null
|
|
279
275
|
}
|
|
280
276
|
});
|
|
281
|
-
|
|
282
|
-
const fnResult =
|
|
283
|
-
|
|
284
|
-
|
|
277
|
+
video_player = result.getByTestId("test-player") as HTMLVideoElement;
|
|
278
|
+
const fnResult = vi
|
|
279
|
+
.spyOn(video_player, "play")
|
|
280
|
+
.mockResolvedValue(undefined);
|
|
281
|
+
assert.equal(fnResult.mock.calls.length, 1);
|
|
285
282
|
});
|
|
286
283
|
test("renders video and download button", async () => {
|
|
287
284
|
const data = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gradio/video",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.5",
|
|
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/atoms": "^0.22.
|
|
14
|
+
"@gradio/atoms": "^0.22.2",
|
|
15
|
+
"@gradio/client": "^2.1.0",
|
|
15
16
|
"@gradio/icons": "^0.15.1",
|
|
16
|
-
"@gradio/image": "^0.
|
|
17
|
-
"@gradio/statustracker": "^0.
|
|
18
|
-
"@gradio/utils": "^0.
|
|
19
|
-
"@gradio/
|
|
20
|
-
"@gradio/upload": "^0.17.6"
|
|
17
|
+
"@gradio/image": "^0.26.0",
|
|
18
|
+
"@gradio/statustracker": "^0.13.0",
|
|
19
|
+
"@gradio/utils": "^0.12.1",
|
|
20
|
+
"@gradio/upload": "^0.17.7"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"@gradio/preview": "^0.
|
|
23
|
+
"@gradio/preview": "^0.16.1"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
"./package.json": "./package.json",
|