diff --git a/CHANGELOG.md b/CHANGELOG.md index dbb2a1fb59..80557280be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2608,6 +2608,7 @@ with gr.Blocks() as demo: Blocks are rendered by [@abidlabs](https://github.com/abidlabs) in [PR 2530](https://github.com/gradio-app/gradio/pull/2530) - Prevent invalid targets of events from crashing the whole application. [@pngwn](https://github.com/pngwn) in [PR 2534](https://github.com/gradio-app/gradio/pull/2534) - Properly dequeue cancelled events when multiple apps are rendered by [@freddyaboulton](https://github.com/freddyaboulton) in [PR 2540](https://github.com/gradio-app/gradio/pull/2540) +- Fixes videos being cropped due to height/width params not being used [@hannahblair](https://github.com/hannahblair) in [PR 4946](https://github.com/gradio-app/gradio/pull/4946) ## Documentation Changes: diff --git a/js/app/src/components/Video/Video.stories.svelte b/js/app/src/components/Video/Video.stories.svelte new file mode 100644 index 0000000000..6009075a7f --- /dev/null +++ b/js/app/src/components/Video/Video.stories.svelte @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/js/upload/src/utils.ts b/js/upload/src/utils.ts index 1ec171458c..e36dddabb2 100644 --- a/js/upload/src/utils.ts +++ b/js/upload/src/utils.ts @@ -7,22 +7,22 @@ export function normalise_file( ): FileData | null; export function normalise_file( - file: Array | null, + file: FileData[] | null, root: string, root_url: string | null -): Array | null; +): FileData[] | null; export function normalise_file( - file: Array | FileData | null, + file: FileData[] | FileData | null, root: string, root_url: string | null -): Array | FileData | null; +): FileData[] | FileData | null; export function normalise_file( - file: Array | FileData | string | null, + file: FileData[] | FileData | string | null, root: string, root_url: string | null -): Array | FileData | null { +): FileData[] | FileData | null { if (file == null) return null; if (typeof file === "string") { return { @@ -30,7 +30,7 @@ export function normalise_file( data: file }; } else if (Array.isArray(file)) { - const normalized_file: Array = []; + const normalized_file: (FileData | null)[] = []; for (const x of file) { if (x === null) { @@ -40,7 +40,7 @@ export function normalise_file( } } - return normalized_file as Array; + return normalized_file as FileData[]; } else if (file.is_file) { if (root_url == null) { file.data = root + "/file=" + file.name; @@ -55,7 +55,7 @@ export const blobToBase64 = (blob: File): Promise => { const reader = new FileReader(); reader.readAsDataURL(blob); return new Promise((resolve) => { - reader.onloadend = () => { + reader.onloadend = (): void => { resolve(reader.result as string); }; }); diff --git a/js/video/src/Player.svelte b/js/video/src/Player.svelte index c4236f207d..7b91fa2576 100644 --- a/js/video/src/Player.svelte +++ b/js/video/src/Player.svelte @@ -76,6 +76,11 @@ dispatch("stop"); dispatch("end"); } + + function open_full_screen(): void { + video.requestFullscreen() + } +
@@ -99,7 +104,7 @@
- + {#if time === duration} {:else if paused} @@ -110,6 +115,8 @@ {format(time)} / {format(duration)} + + -
video.requestFullscreen()}> +
@@ -203,5 +210,7 @@ .wrap { position: relative; background-color: var(--background-fill-secondary); + height: var(--size-full); + width: var(--size-full); } diff --git a/package.json b/package.json index 2cd3113c5d..bbe2e73263 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "ci:version": "changeset version && pnpm i --lockfile-only", "storybook": "storybook dev -p 6006 --config-dir js/storybook", "build-storybook": "storybook build --config-dir js/storybook", - "chromatic": "chromatic --exit-zero-on-changes", + "chromatic": "chromatic", "test:ct": "playwright test -c ./.config/playwright-ct.config.ts" }, "type": "module",