React-native-sound: Handling sound interruptions

Created on 14 Jun 2017  路  7Comments  路  Source: zmxv/react-native-sound

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)

  • iOS 10.3
question

Most helpful comment

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

All 7 comments

+1

bump

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.

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.

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

Merged your PR. Thanks for the help

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

Was this page helpful?
0 / 5 - 0 ratings