scottschiller / SoundManager2

A JavaScript Sound API supporting MP3, MPEG4 and HTML5 audio + RTMP, providing reliable cross-browser/platform audio control in as little as 12 KB. BSD licensed.
http://www.schillmania.com/projects/soundmanager2/
Other
4.99k stars 768 forks source link

External sounds are prevented in background [Mobile Firefox, Mobile Safari] #257

Open kharissa opened 4 years ago

kharissa commented 4 years ago

I am using the react-sound component that uses SoundManager2 library. I have already posted my issue in react-sound but have not got any responses so I thought I'd also post here too:

The sound in our app is playing as expected, however each time a sound is played on our app it causes the background music (e.g. Spotify) to stop playing. This only happens for users in certain environments (Firefox on Android and Safari on iOS Mobile specifically).

We have already implemented the following in App.js but the problem persists:

function App() {
  window.soundManager.setup({ ignoreMobileRestrictions: true });
  return (
    // ...
  );
}

Is there anything else that I should be looking at? Is there a different way to implement the above?