* fix #5229

* add changeset

* add simple test for #5229 similar to default one

* Lint

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
This commit is contained in:
Artem Kotov 2023-08-16 18:36:45 +04:00 committed by GitHub
parent 2b397791fe
commit 1ecf88ac5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 0 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:fix #5229

View File

@ -239,6 +239,8 @@ class Video(
return output_file_name
elif not self.include_audio:
output_file_name = str(file_name.with_name(f"muted_{file_name.name}"))
if Path(output_file_name).exists():
return output_file_name
if wasm_utils.IS_WASM:
raise wasm_utils.WasmUnsupportedError(
"include_audio=False is not supported in the Wasm mode."

View File

@ -1332,6 +1332,11 @@ class TestVideo:
output2 = video_input.preprocess(x_video)
assert output1 == output2
video_input = gr.Video(include_audio=False)
output1 = video_input.preprocess(x_video)
output2 = video_input.preprocess(x_video)
assert output1 == output2
video_input = gr.Video(label="Upload Your Video")
assert video_input.get_config() == {
"autoplay": False,