import panel as pn pn.extension()
Video Pane displays a video player given a local or remote video file. The widget also allows access and control over the player state including toggling of playing/
loop state, the current
time, and the
volume. Depending on the browser the video player supports
ogg containers and a variety of codecs.
For layout and styling related parameters see the customization user guide.
name(str): The title of the widget
loop(boolean): Whether to loop when reaching the end of playback
object(string): Local file path or remote URL pointing to audio file
paused(boolean): Whether the player is paused
autoplay(boolean): When True, it specifies that the output will play automatically. In Chromium browsers this requires the user to click play once
muted(boolean): When True, it specifies that the output should be muted
throttle(int): How frequently to sample the current playback time in milliseconds
time(float): Current playback time in seconds
volume(int): Volume in the range 0-100
Video Pane can be constructed with a URL pointing to a remote video file or a local video file (in which case the data is embedded).
video = pn.pane.Video('https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_640_3MG.mp4', width=640, height=360, loop=True) video
The player can be controlled using its own widgets, as well as by using Python code as follows. To pause or unpause it in code, use the
#video.paused = False
The current player
time can be read and set with the time variable (in seconds):
volume may also be read and set:
video.volume = 50