diff --git a/ios/RCTWebRTC/VideoCaptureController.m b/ios/RCTWebRTC/VideoCaptureController.m index 2f8447004..4307e37f3 100644 --- a/ios/RCTWebRTC/VideoCaptureController.m +++ b/ios/RCTWebRTC/VideoCaptureController.m @@ -206,6 +206,13 @@ - (AVCaptureDeviceFormat *)selectFormatForDevice:(AVCaptureDevice *)device int currentDiff = INT_MAX; for (AVCaptureDeviceFormat *format in formats) { + // Only use multi cam formats when on multi cam supported devices. + if (@available(iOS 13.0, macOS 14.0, tvOS 17.0, *)) { + if (AVCaptureMultiCamSession.multiCamSupported && !format.multiCamSupported) { + continue; + } + } + CMVideoDimensions dimension = CMVideoFormatDescriptionGetDimensions(format.formatDescription); FourCharCode pixelFormat = CMFormatDescriptionGetMediaSubType(format.formatDescription); int diff = abs(targetWidth - dimension.width) + abs(targetHeight - dimension.height); @@ -252,4 +259,4 @@ - (void)resetFrameRateForDevice:(AVCaptureDevice *)device { @end -#endif \ No newline at end of file +#endif