I am developing a WebRTC based iOS application. As part of my application, I also play a YouTube video through using https://developers.google.com/youtube/v3/guides/ios_youtube_helper. I use the following code to mix the audio;
NSError *error = nil;
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord
withOptions: AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionDefaultToSpeaker
error: &error];
if (error != nil) {
NSLog(@"Problem setting up AVAudioSession to mix with others");
}
The problem is when WebRTC chat is on, YouTube video volume is extremely low. If I disconnect WebRTC chat, YouTume video volume becomes normal. Neither WebRTC nor YouTube player is setting AVAudioSessionCategoryOptionDuckOthers or chaging AudioSession category.
Is there any problem in WKWebView working shared AVAudioSession?
Thanks,