mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-25 12:10:31 +08:00
* 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:
parent
2b397791fe
commit
1ecf88ac5f
5
.changeset/whole-buttons-drive.md
Normal file
5
.changeset/whole-buttons-drive.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
fix:fix #5229
|
@ -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."
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user