gradio/demo/video_component/run.py
pngwn a23bc03aeb
ensure video resets state correctly when a new src is loaded (#3117)
* improve is playing, remove console error

* add video demo to all_demos

* fix demo

* fix bug

* changelog + notebooks

* cleanup

* fix choppy video resizing

* reduce flashing due to prediction request, video loading + rendering

* fix notebooks

* changelog
2023-02-03 17:36:31 +00:00

23 lines
450 B
Python

import gradio as gr
import os
a = os.path.join(os.path.dirname(__file__), "files/world.mp4") # Video
b = os.path.join(os.path.dirname(__file__), "files/a.mp4") # Video
c = os.path.join(os.path.dirname(__file__), "files/b.mp4") # Video
demo = gr.Interface(
fn=lambda x: x,
inputs=gr.Video(type="file"),
outputs=gr.Video(),
examples=[
[a],
[b],
[c],
],
)
if __name__ == "__main__":
demo.launch()