diff --git a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m index fb5dd63492..ff1a7a1416 100644 --- a/sdk/objc/components/capturer/RTCCameraVideoCapturer.m +++ b/sdk/objc/components/capturer/RTCCameraVideoCapturer.m @@ -506,21 +506,28 @@ - (void)handleApplicationDidBecomeActive:(NSNotification *)notification { #pragma mark - Private - (AVCaptureSession *)createCaptureSession { + AVCaptureSession *result = nil; #if TARGET_MULTICAM_CAPABLE if (AVCaptureMultiCamSession.isMultiCamSupported) { // AVCaptureMultiCamSession exists and device supports multi-cam. if (_sharedMultiCamSession == nil) { _sharedMultiCamSession = [[AVCaptureMultiCamSession alloc] init]; } - return _sharedMultiCamSession; + result = _sharedMultiCamSession; } else { // AVCaptureMultiCamSession exists but device doesn't support multi-cam. - return [[AVCaptureSession alloc] init]; + result = [[AVCaptureSession alloc] init]; } #else // AVCaptureMultiCamSession doesn't exist with this platform, use AVCaptureSession. - return [[AVCaptureSession alloc] init]; + result = [[AVCaptureSession alloc] init]; #endif +#if (TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_MACCATALYST) && !TARGET_OS_VISION + if (@available(iOS 7.0, tvOS 17.0, macCatalyst 14.0, *)) { + result.automaticallyConfiguresApplicationAudioSession = false; + } +#endif + return result; } - (BOOL)isUsingSelfCreatedMultiCamSession {