Fix for issue #386 - camera cras- ios 10 simulator

This commit is contained in:
Roman Mandryk 2016-09-24 21:18:41 +08:00 committed by GitHub
parent 1747ec4b0a
commit 000c09a2cc
1 changed files with 5 additions and 4 deletions

View File

@ -30,10 +30,11 @@ RCT_EXPORT_MODULE();
- (UIView *)view
{
self.session = [AVCaptureSession new];
self.previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session];
self.previewLayer.needsDisplayOnBoundsChange = YES;
#if !(TARGET_IPHONE_SIMULATOR)
self.previewLayer = [AVCaptureVideoPreviewLayer layerWithSession:self.session];
self.previewLayer.needsDisplayOnBoundsChange = YES;
#endif
if(!self.camera){
self.camera = [[RCTCamera alloc] initWithManager:self bridge:self.bridge];
}