Commit 9a98cd6e authored by Marijan Vukcevich's avatar Marijan Vukcevich Committed by Alexander Shishkov

Update cap_ios_abstract_camera.mm

AVCaptureVideoPreviewLayer setOrientation is depricated. This fixes the warning and provides backward compatibility.
parent 8cbb284b
......@@ -278,9 +278,21 @@
{
self.captureVideoPreviewLayer = [[AVCaptureVideoPreviewLayer alloc] initWithSession:self.captureSession];
if ([self.captureVideoPreviewLayer isOrientationSupported]) {
[self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
}
if ([self.captureVideoPreviewLayer respondsToSelector:@selector(connection)])
{
if ([self.captureVideoPreviewLayer.connection isVideoOrientationSupported])
{
[self.captureVideoPreviewLayer.connection setVideoOrientation:self.defaultAVCaptureVideoOrientation];
}
}
else
{
// Deprecated in 6.0; here for backward compatibility
if ([self.captureVideoPreviewLayer isOrientationSupported])
{
[self.captureVideoPreviewLayer setOrientation:self.defaultAVCaptureVideoOrientation];
}
}
if (parentView != nil) {
self.captureVideoPreviewLayer.frame = self.parentView.bounds;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment