iOS SDK - Custom UI - Can't play music and meeting audio together

Description
I’m currently working on a Zoom integration which involves using Custom UI. It’s going quite well thanks to the documentation and code examples available. However I’m having an issue on iOS where if a user is in a meeting, and they start some music in, for example, Spotify, the meeting’s audio cuts out. That is, although the video is still displayed and updated, no sound can be heard until the user goes and stops their music.

I’ve spent some time looking into this, and having tested the Sample app, I can see that the audio mixing works when using the preset UI, however, when switching to the Custom UI in the provided sample app I see the same issue that I’m experiencing.

My question is, then, are there any configuration options I can change so that music can be played along side meeting audio when using the Custom UI?

Which version?
mobileRTC Version: 4.6.15805.0403

To Reproduce(If applicable)

  1. Open the Zoom iOS SDK Sample App
  2. Enable Custom UI from settings
  3. Enter a meeting
  4. Connect audio
  5. Confirm that meeting audio can be heard
  6. Open Spotify (Or music app of your choice)
  7. Start some music
  8. Return to the Sample App
  9. Meeting audio can no longer be heard

Smartphone (please complete the following information):

  • Device: iPhone SE (2016)
  • OS: iOS 13.3.1

Additional context
It’s possible to play meeting audio and music audio with the Android SDK.

Hi tony_mz,

Thanks for using Zoom SDK and thanks for the detailed explanation. Let me forward this to the engineering team for further investigation and get back to you shortly.

Thanks!

Hi tony_mz,

Please have a try with the following:

  1. Before starting a meeting, add the following:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];
  1. When you are returning to your own app, in the delegate applicationDidBecomeActivie, add the following:
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil];

Please have a try and see if it helps. Thanks!

Thanks for the reply, I appreciate it. Unfortunately I wasn’t able to solve the problem with this.

I’m testing with the MobileRTCSample project, and so I added this line to
- (void)joinMeeting:(NSString*)meetingNo withPassword:(NSString*)pwd on line 409, MainViewController.m, and also to the AppDelegate applicationDidBecomeActivie.

This message shows up in the log when I press play on the music while in a meeting with audio.
2020-05-07 17:56:33.973623+0100 MobileRTCSample[863:128886] audioSessionDidInterruptNotification 1

Just to confirm my exact steps when testing this:

  1. Run MobileRTCSample on my iPhone SE
  2. Go to Settings -> Meeting Settings and ensure ‘Custom Meeting’ is enabled
  3. Click Join a Meeting, enter meeting number, click ok
  4. Enter display name, and click ok
  5. Admit myself to the meeting from my host client
  6. Click ‘Join Audio’ in MobileRTCSample, then Call via Internet
  7. Confirm that the MobileRTCSample is receiving sound from my host client
  8. Swipe up the iOS control panel
  9. Click play on the audio widget
  10. Swipe down the iOS control panel to return to the MobileRTCSample app
  11. Confirm that the MobileRTCSample app is no longer receiving sound from the meeting

Thank you.

Hi tony_mz,

Thanks for the detailed information. I will forward this to the engineering team for further investigation. Will get back to you shortly.

Thanks!

1 Like

Just an update, I’ve now managed to resolve the issue.
Thank you for your help and advice.

Hi tony_mz,

Glad to hear that the problem has resolved. May I inquire how you resolve this issue? Would like to know for future reference.

Thanks!

No problem, I ended up using method swizzling to swap out the AVAudioSession.setCategory method, such that it added in the .mixWithOthers option on every call.

Thank you very much for sharing this. Happy Zooming! :slight_smile: