I have an app for the 30-seconds game: https://30-seconds.streamlit.app/ where players get 30 seconds to describe the words in view. After the time is up a sound should play.
This works the first round, but in following rounds the audio widget is displayed but the autoplay is no longer triggered. How can I make the app play the sound each round?
Thanks for sharing this question! I’m not able to get the app to play the sound the first time – did you remove the part of the app that played the sound?
Sorry for the delayed follow up! I’ve been trying to debug this issue and found out that browsers won’t autoplay audio files if the current user hasn’t interacted with the page by clicking somewhere during the initial loading of the page – this means that autoplay won’t work on st.audio widgets that are added after the initial loading of the app.
I’ve asked the team to update our doc for st.audio to make this much clearer, since it’s obviously a limitation that can be quite frustrating if you weren’t aware until after you tried implementing it. Apologies for the confusion!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.