ios. If found to play mode when required multiple video streams simultaneously
AVAudioSessionCategoryPlayAndRecord
, The subsequent addition of playing video stream can not go in speaker; and, if the first player in setting this mode, found not working, and sometimes can, sometimes no effect;
Therefore, the information found in the online search, you can use the following mode
AVAudioSessionCategoryMultiRoute
Open support multiple video streams, this would be no problem;
dispatch_async(dispatch_get_main_queue(), ^{
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryMultiRoute withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionMixWithOthers | AVAudioSessionCategoryOptionAllowBluetooth error:nil];
[[AVAudioSession sharedInstance] setActive:YES error:nil];
});