zmxv / react-native-sound

React Native module for playing sound clips
MIT License
2.79k stars 748 forks source link

Handling sound interruptions #201

Open jamesmead opened 7 years ago

jamesmead commented 7 years ago

Thanks for the library!

Does anyone know if this module handles sound interruptions such as incoming calls etc?

I have a simple app that plays audio in the background, however when there is a call or the alarm runs, the playback of the sound file stops.

I have enabled background mode and my sound category settings are as follows: Sound.setCategory('Playback', false)

Choujiji commented 7 years ago

+1

jamesmead commented 7 years ago

bump

ghost commented 7 years ago

Wondering the same thing. When I activate Siri or get a phone call the audio stops, but I would love to have a handler where I could appropriately respond to that stop.

natashache commented 6 years ago

I'm having this issue, too. Would like to have playing stop when there's an incoming call and then resume when the call is finished.

kurokky commented 6 years ago

Hi, guys! I changed to specification to pause when I put out the headphone jack from my device or received a call. https://github.com/kurokky/react-native-sound/tree/pause_status

But I don't know other people needs to "resume" or "stop" when that time. That's why there is not resume on my branch. If you want to catch only incoming calls status, I think better using another library. https://github.com/priteshrnandgaonkar/react-native-call-detection

trepidity commented 6 years ago

Merged your PR. Thanks for the help

deyanskiq commented 4 years ago

Are there any event handlers that can be used to handle interruptions?

VaruzhKhachatryan commented 2 years ago

+1