mirror of
https://github.com/gradio-app/gradio.git
synced 2025-03-31 12:20:26 +08:00
Switch default order for sources for gr.Video
so that upload is the default (#6994)
* switch default video source * add changeset * fix test --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
parent
ccf317fc97
commit
623bc1aeb1
5
.changeset/brown-crews-tap.md
Normal file
5
.changeset/brown-crews-tap.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": minor
|
||||
---
|
||||
|
||||
feat:Switch default order for sources for `gr.Video` so that upload is the default
|
@ -111,7 +111,7 @@ class Video(Component):
|
||||
min_length: The minimum length of video (in seconds) that the user can pass into the prediction function. If None, there is no minimum length.
|
||||
max_length: The maximum length of video (in seconds) that the user can pass into the prediction function. If None, there is no maximum length.
|
||||
"""
|
||||
valid_sources: list[Literal["upload", "webcam"]] = ["webcam", "upload"]
|
||||
valid_sources: list[Literal["upload", "webcam"]] = ["upload", "webcam"]
|
||||
if sources is None:
|
||||
self.sources = valid_sources
|
||||
elif isinstance(sources, str) and sources in valid_sources:
|
||||
|
@ -1464,7 +1464,7 @@ class TestVideo:
|
||||
video_input = gr.Video(label="Upload Your Video")
|
||||
assert video_input.get_config() == {
|
||||
"autoplay": False,
|
||||
"sources": ["webcam", "upload"],
|
||||
"sources": ["upload", "webcam"],
|
||||
"name": "video",
|
||||
"show_share_button": False,
|
||||
"show_label": True,
|
||||
|
Loading…
x
Reference in New Issue
Block a user