mirror of
https://github.com/status-im/react-native-camera.git
synced 2025-02-24 09:48:17 +00:00
Merge pull request #1614 from n1ru4l/fix-1612
Fix failing iOS build #1612
This commit is contained in:
commit
92e8ececc9
@ -441,7 +441,7 @@ static NSDictionary *defaultFaceDetectorOptions = nil;
|
|||||||
[self updateSessionAudioIsMuted:!!options[@"mute"]];
|
[self updateSessionAudioIsMuted:!!options[@"mute"]];
|
||||||
|
|
||||||
AVCaptureConnection *connection = [self.movieFileOutput connectionWithMediaType:AVMediaTypeVideo];
|
AVCaptureConnection *connection = [self.movieFileOutput connectionWithMediaType:AVMediaTypeVideo];
|
||||||
if (self.videoStabilizationMode != nil) {
|
if (self.videoStabilizationMode != 0) {
|
||||||
if (connection.isVideoStabilizationSupported == NO) {
|
if (connection.isVideoStabilizationSupported == NO) {
|
||||||
RCTLogWarn(@"%s: Video Stabilization is not supported on this device.", __func__);
|
RCTLogWarn(@"%s: Video Stabilization is not supported on this device.", __func__);
|
||||||
} else {
|
} else {
|
||||||
|
@ -97,10 +97,10 @@ RCT_EXPORT_VIEW_PROPERTY(onPictureSaved, RCTDirectEventBlock);
|
|||||||
+ (NSDictionary *)validVideoStabilizationModes
|
+ (NSDictionary *)validVideoStabilizationModes
|
||||||
{
|
{
|
||||||
return @{
|
return @{
|
||||||
@"off": AVCaptureVideoStabilizationModeOff,
|
@"off": @(AVCaptureVideoStabilizationModeOff),
|
||||||
@"standard": AVCaptureVideoStabilizationModeStandard,
|
@"standard": @(AVCaptureVideoStabilizationModeStandard),
|
||||||
@"cinematic": AVCaptureVideoStabilizationModeCinematic,
|
@"cinematic": @(AVCaptureVideoStabilizationModeCinematic),
|
||||||
@"auto": AVCaptureVideoStabilizationModeAuto
|
@"auto": @(AVCaptureVideoStabilizationModeAuto)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ type PropsType = typeof View.props & {
|
|||||||
captureAudio?: boolean,
|
captureAudio?: boolean,
|
||||||
useCamera2Api?: boolean,
|
useCamera2Api?: boolean,
|
||||||
playSoundOnCapture?: boolean,
|
playSoundOnCapture?: boolean,
|
||||||
videoStabilizationMode?: string,
|
videoStabilizationMode?: number | string,
|
||||||
pictureSize?: string,
|
pictureSize?: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
|
|||||||
GoogleVisionBarcodeDetection: CameraManager.GoogleVisionBarcodeDetection,
|
GoogleVisionBarcodeDetection: CameraManager.GoogleVisionBarcodeDetection,
|
||||||
FaceDetection: CameraManager.FaceDetection,
|
FaceDetection: CameraManager.FaceDetection,
|
||||||
CameraStatus,
|
CameraStatus,
|
||||||
VideoStabilization: CameraManager.VideoStabilization || {},
|
VideoStabilization: CameraManager.VideoStabilization,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Values under keys from this object will be transformed to native options
|
// Values under keys from this object will be transformed to native options
|
||||||
@ -170,6 +170,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
|
|||||||
faceDetectionLandmarks: (CameraManager.FaceDetection || {}).Landmarks,
|
faceDetectionLandmarks: (CameraManager.FaceDetection || {}).Landmarks,
|
||||||
faceDetectionClassifications: (CameraManager.FaceDetection || {}).Classifications,
|
faceDetectionClassifications: (CameraManager.FaceDetection || {}).Classifications,
|
||||||
googleVisionBarcodeType: (CameraManager.GoogleVisionBarcodeDetection || {}).BarcodeType,
|
googleVisionBarcodeType: (CameraManager.GoogleVisionBarcodeDetection || {}).BarcodeType,
|
||||||
|
videoStabilizationMode: CameraManager.VideoStabilization || {},
|
||||||
};
|
};
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
@ -200,7 +201,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
|
|||||||
captureAudio: PropTypes.bool,
|
captureAudio: PropTypes.bool,
|
||||||
useCamera2Api: PropTypes.bool,
|
useCamera2Api: PropTypes.bool,
|
||||||
playSoundOnCapture: PropTypes.bool,
|
playSoundOnCapture: PropTypes.bool,
|
||||||
videoStabilizationMode: PropTypes.string,
|
videoStabilizationMode: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||||
pictureSize: PropTypes.string,
|
pictureSize: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -234,6 +235,7 @@ export default class Camera extends React.Component<PropsType, StateType> {
|
|||||||
useCamera2Api: false,
|
useCamera2Api: false,
|
||||||
playSoundOnCapture: false,
|
playSoundOnCapture: false,
|
||||||
pictureSize: '1920x1080',
|
pictureSize: '1920x1080',
|
||||||
|
videoStabilizationMode: 0,
|
||||||
};
|
};
|
||||||
|
|
||||||
_cameraRef: ?Object;
|
_cameraRef: ?Object;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user