手机关闭时在Chrome/Firefox手机上重复播放音频 [英] Repeat audio on Chrome/Firefox mobile when phone is off

查看:91
本文介绍了手机关闭时在Chrome/Firefox手机上重复播放音频的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个供自己使用的小型语言学习应用程序,该应用程序使用howlerjs播放音频.音频循环播放,直到结束时,音频会重新开始播放,直到用户干预为止.

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.

即使手机关闭了,我是否可以使用JavaScript技巧来重新启动它?还是可以更改Chrome/Firefox中的设置以阻止Chrome/Firefox阻止重新启动?

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?

推荐答案

我没看到,howlerjs具有循环属性,可以将其设置为true.完成后,我总是通过代码再次重新启动音频.感谢 Kaiido 现在可以使用了.

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.

这篇关于手机关闭时在Chrome/Firefox手机上重复播放音频的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆