Safari - HTML5 audio won't play when tab is in the background

雨燕双飞 提交于 2019-12-24 00:39:15

问题


I have a react app that uses react-sound (basically, HTML5 Audio) to play a sound when a new notification is triggered. I want this sound to play when the tab is backgrounded in Safari, however that does not seem to work.

The sound does play when the tab is in the foreground.

Does anyone know of a workaround for this?

来源:https://stackoverflow.com/questions/38269953/safari-html5-audio-wont-play-when-tab-is-in-the-background

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