I’ve run into this issue (blocked autoplay of sounds) in the past. My basic workaround is to require a click before the “actual” test/demonstration prototype starts. Here’s the critical part of Google Chrome’s autoplay policy (similar to other browsers):
- Autoplay with sound is allowed if:
- The user has interacted with the domain (click, tap, etc.).
- On desktop, the user’s Media Engagement Index threshold has been crossed, meaning the user has previously played video with sound.
- The user has added the site to their home screen on mobile or installed the PWA on desktop.
The first bullet is the key. (Pre)Start your prototype with a (pre)click. You can have a dynamic panel or group that covers the entire screen/viewport and has a “Start” button that just hides this dp or group and launches the sound. If you are doing user testing and don’t want the user to have to click anything first, then have a test moderator click a Start button on the prototype.
I tested this out with the demo above on Windows 11, latest Chrome browser (ver 116) and it works. The “pre-click” must be on the same page or it won’t work. Here’s my demo test using the prototype above:
Never Gonna Give You Up -autoplay.rp (8.0 MB)
-
Page 0 attempts to have a pre-click on a separate page, loading Page 1 that has a Page Loaded event firing the Play button’s CustomClickEvent. The sound won’t play though until the user clicks a button on Page 1 (…following the existing interaction logic it would need to be the Pause button then the Play button–and then the sound plays.)
-
Page 1b uses a “Launcher” group and button click to get things going, but it leaves the prototype in an otherwise “unused” state–nothing happens until the mouse is moved. When a mouse movement is detected, the Play button is triggered and the sound “autoplays”. (I use the value of OnLoadVariable to make sure the autoplay is only triggered on the first mouse movement, otherwise the Pause and Play buttons won’t work correctly as the whole thing starts over on any and every mouse movement.) You could use a keypress, scroll, other gesture, delay, or system event to trigger the “prototype start” and the sound to play instead of the Page Mouse Move event.