Search code examples
javascriptgoogle-chromefirefoxmobile-browserhowler.js

Repeat audio on Chrome/Firefox mobile when phone is off


I wrote a small language learning app for my own use which plays audio recordings with howlerjs. The audio is played in a loop, when the end is reached, it just restarts until the user intervenes.

To the Problem: When I turn off my phone (standby) the audio file still plays - like it should - but is not restarted ones the end is reached.

Is there a JavaScript trick I can use to restart it even when my phone is off? Or can I change a setting in Chrome/Firefox to stop Chrome/Firefox from preventing a restart?


Solution

  • I didn't see, that howlerjs has a loop attribute, one can set to true. I always restarted the audio again via code, when it was finished. Thanks to Kaiido it works now.