Video interrupts audio in other apps

#1

Hi there!

I’m currently having an issue with video + external audio where the video, upon clicking “Play” after it’s paused, causes background audio to pause.

Example Situation:

  1. I have Spotify open in the background playing music
  2. I open my app (Spotify still playing in background)
  3. I play a video in my app (Spotify still playing in background)
  4. I pause the video in my app (Spotify still playing in the background)
  5. I continue the video by clicking play again in my app (Spotify music pauses)

This only happens in the Built version of the app. It works perfectly fine when run through the Expo client. Would anyone have any ideas on what might need to be added to our build (assuming that’s where the issue lies) to resolve this?

More Info:

The AVAudioSession is set to Ambient in our AppDelegate.m:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];

Also using this on componentDidMount():

Audio.setAudioModeAsync({
	allowsRecordingIOS: false,
	interruptionModeIOS: Audio.INTERRUPTION_MODE_IOS_MIX_WITH_OTHERS,
	playsInSilentModeIOS: true,
	shouldDuckAndroid: true,
	interruptionModeAndroid: Audio.INTERRUPTION_MODE_ANDROID_DUCK_OTHERS,
});

Thanks in advance!

  • J
#2

Hi! Does this issue still occur if you serve the app to the Expo Client with development mode turned off? If it does still happen, can you upload an MCVE we can use to reproduce the issue?

#3

Hi @dikaiosune! I haven’t tried out development mode on/off when running on the Expo Client yet, but I’ll see if that has any effect on it!

To clarify though, the issue doesn’t happen on the Expo Client (I believe I last tested in development mode).
The issue only happens to the built-out app (TestFlight / App Store version).

Thanks for the pointers though and I’ll post back on the results of the test and if it doesn’t end up working I will post a MCVE for it! :smiley:

closed #4

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.