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

2019-07-10 00:25发布

问题:

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?