Repeat audio on Chrome/Firefox mobile when phone is off

百般思念 提交于 2020-01-25 07:04:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/58748053/repeat-audio-on-chrome-firefox-mobile-when-phone-is-off

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!