orientation in landscape initializes properly

This commit is contained in:
Kyle Corbitt 2016-02-05 12:02:45 +00:00
parent 1feb274458
commit 5865a1affc
1 changed files with 10 additions and 1 deletions

View File

@ -213,7 +213,16 @@ RCT_EXPORT_METHOD(changeFlashMode:(NSInteger)flashMode) {
}
RCT_EXPORT_METHOD(changeOrientation:(NSInteger)orientation) {
self.previewLayer.connection.videoOrientation = orientation;
if (self.previewLayer.connection.isVideoOrientationSupported) {
self.previewLayer.connection.videoOrientation = orientation;
}
else {
// Setting videoOrientation isn't yet supported, so we have to wait until
// startSession has finished to set it. Put this in the queue behind.
dispatch_async(self.sessionQueue, ^{
self.previewLayer.connection.videoOrientation = orientation;
});
}
}
RCT_EXPORT_METHOD(changeTorchMode:(NSInteger)torchMode) {