Autoplay is a leading cause of visitors bouncing from your website.
It’s 2:00 AM in the morning and you are lying in bed with your significant other browsing the Internet. You discover a website, and it immediately begins playing music. In panic, you try to find the almost invisible volume icon or button on your device to turn the volume off. You leave the website as soon as possible (this is called a bounce), and never come back.
Is this what you want?
Autoplay is blocked by default by most browsers.
Most browsers block autoplay unless you meet specific requirements. For example, one requirement is that you must have interacted with the website first. This means a click or a tap on something. The Chrome browser has published their policies in this link. The Firefox browser and others have similar policies.
Autoplay may be allowed if:
- The audio is muted or its volume is set to 0
- The user has interacted with the site (by clicking, tapping, pressing keys, etc.)
- If the site has been allowlisted; this may happen either automatically if the browser determines that the user engages with media frequently, or manually through preferences or other user interface features
- If the autoplay feature policy is used to grant autoplay support to an iFrame.
Play audio using a player, not behind people’s back.
The best approach, if you want to play audio on your website, is to give your visitors a player they can interact with. Allow them to start and stop the audio, and give them an interface they can use to control the sound.