Help me please. My glb animation autoplay works, but the music autoplay is not working. Some device can play the music once. But after refresh there is no music. Some device no music at all.
Hi @valen_antonius
You will need a click to activate the audio.
Here I’d suggest either a click in the main experience to activate it or perhaps adding a splash screen with a ‘launch’ button and, from that click event then you can trigger the audio and it should be playing when the experience appears behind the splash screen.
You could very well take this playground example as a reference:
Hope this helps
Thank you for your reply. Is this the only way?
Because the earlier version my autoplay is working just fine on the glb animation and music. Thank youu
@valen_antonius unfortunately, yes this is known to be the only way.
To be clear, this is not a limitation on the technology in any way. This is based on web standards, which are majorly defined by both the W3C and the Mozilla Foundation.
You can find out more about this here:
You will need a click in some way somewhere in the experience to allow the sound to play. This doesn’t necessarily need to be a splash screen, as long as there’s a click registered by the user in the experience the audio should play without a problem after the click.
to give more context, Autoplay policies for videos with audio (or audio by itself) differ between browsers, such as Safari and Chrome. By default, Safari will only autoplay a video if it doesn’t have an audio track or if the video element includes the “muted” attribute. Playback will pause if the element gains an audio track or becomes unmuted without user interaction. You can find more information about Safari’s autoplay policies in the official Apple documentation.
For Chrome, autoplay with sound is allowed if the user has interacted with the domain (e.g., through a click or tap). More details about Chrome’s autoplay policy changes can be found in the Google Developers documentation.
If you’re looking for an example project that plays a video with sound when the user taps on an image target, you can check out 8th Wall’s Playground example.