Embedding Youtube failed

Hi there,
Today when I tried to embed Youtube video using st.video(). It showed the error message: TypeError : string argument without an encoding

Any idea, guys?

Hey @li_yulei and welcome to the community :blush:,

Mind providing a sample of your code so we can help troubleshoot? Also, what version of Streamlit are you using and OS?

1 Like

Hi @tc1,
Thanks for your response.
I upgraded streamlit to 0.57.3 and the error message changed
My code is as simple as:

import streamlit as st
url = 'https://youtu.be/FVsvrFAWDTM
st.video(url)

Error message:
AttributeError: ‘EnumTypeWrapper’ object has no attribute 'NATIVE’

OS: Mac
Streamlit: 0.57.3

Thanks a lot.
Yulei

Hey @li_yulei,

Try running it like this if possible:

import streamlit as st
st.video('https://youtu.be/FVsvrFAWDTM') 

This should do the trick and get it to work for you. Hope this helps and feel free to let us know if you need any additional help :+1:

@tc1 It works now! Thanks a lot, mate

1 Like

Hey…its not working in my case…i am facing this issue…
AttributeError: ‘EnumTypeWrapper’ object has no attribute ‘NATIVE’
Thank you…

HI @Mohit_Sharma -

Can you confirm what operating system and version of Streamlit you are using? I ran the snippet provided by @tc1 and it worked for version 0.60.0 on Ubuntu 18.04 LTS