Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

scritch editor

A simple, customizable audio player designed for artists · By torcado

Auto-playing track when page loads

A topic by Eric Alsandor | Spider00x created Feb 09, 2023 Views: 213 Replies: 1
Viewing posts 1 to 2

I was hoping to auto play a track when the pages load I have to manually play it everytime, and thats with automatically start box checked, any ideas?

Developer

Hi! Unfortunately, this won’t work in most cases due to browsers preventing autoplaying audio until after the user interacts with the page.

I’ve updated the editor and player with a new autoplay option, which you can enable by editing the config.json file and adding "autoplay": true and "feature": true to the track you want to start playing on load. On itch, this will only work if you disable “automatically start on page load” in the itch.io options, since that provides a button for users to click to load the project, which counts as user interaction for the page. (I haven’t tested this, but I presume it will work)

If that works for your case, feel free to try it out!