St.video input error

videoplayer = st.text_input("**Enter Youtube URL**:")
st.video(videoplayer)

st.video takes the input of nothing and gives me an error. I want st.video to wait before I input something without giving me an error. Thanks for your help.

You could encapsulate st.video within an if statement.

videoplayer = st.text_input("**Enter Youtube URL**:")

if videoplayer:
    st.video(videoplayer)

That won’t validate that the text input is a valid URL though.

Thank you. I really appreciate it!

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