St.video set start time after creation?

I want to be able to jump around in a video.
st.video() has an argument start_time. This works fine when the widget is created. But can I also change the start time of the video afterwards?

the code below does not work, but is there something similar?

v = st.video("url")
if st.button("Jump"):
    v.start_time = 100

I think I could solve it with st.empty().
But one problem still exists: Can I automatically start the video player after creating it?

So far I have:

placeholder = st.empty()
placeholder.video('url')

if st.button("Jump"):
    placeholder.video('url', start_time=100)

Hey!

Using the component streamlit-player does the trick for me as long as you set the playing and muted arguments to True.

Autoplay
As of Chrome 66, videos must be muted in order to play automatically. Some players, like Facebook, cannot be unmuted until the user interacts with the video, so you may want to enable controls to allow users to unmute videos themselves. Please set muted={true} .

import streamlit as st
from streamlit_player import st_player

st_player(url, playing=True, muted=True)

Happy Streamlitin’
Fanilo :balloon:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.