Twitch embedding

Hi everyone,

I am currently trying to use streamlit-player to embed twitch videos and lives on my app. Using this package allowed me to do so, but only on my local version. Everything is working fine on local, but I get a message error from Twitch once I deploy the app (“player.twitch.tv doesn’t allow the connection”)
I get from the documentation that I need a SSL connection. When I add “&parent=mywebsite.streamlit.io”, I get a black screen in the player, but no error.

Is there a way to embed Twitch in streamlit?

Thanks !

ps: here’s the code that works on local :

link = st.text_input(label= "Link of the video")
play = st.button("play the video")
if play:
    st_player(f"{link}&parent=share.streamlit.io&parent=mywebsite.streamlit.io")

get Twitch API key

Hey,

Thanks for your answer. I read the documentations in order to use Twitch API but it seems quite hard to implement in streamlit as I cannot use in st.markdown.

If you have more information on how to use this API in streamlit I would gladly read it, as I am now really stuck !

Well as a “solution” : I deployed on heroku.

I couldn’t manage to make the “&parent” parameter work on streamlit cloud (where the domain is .io), but it worked nicely on heroku where I just added “&parent=myappname.heroku.com” to the url (as explained on the twitch documentation) in a st.markdown.

Hope it might help someone !