Fix for back camera showing briefly when the type property is set to 'front'.

The first time an app is run that uses this component with the type set to 'front', the back camera shows briefly before the component obeys the type property and switches to the front camera. The presetCamera should be set to the proper camera type set in the props when the component is created.
This commit is contained in:
PJ Cabrera 2015-12-02 11:39:02 -08:00
parent d911c99987
commit 1b79493221
1 changed files with 6 additions and 0 deletions

View File

@ -14,6 +14,12 @@
RCT_EXPORT_MODULE();
- (UIView *)viewWithProps:(__unused NSDictionary *)props
{
self.presetCamera = ((NSNumber *)props[@"type"]).integerValue;
return [self view];
}
- (UIView *)view
{
return [[RCTCamera alloc] initWithManager:self bridge:self.bridge];