Skip to content

Commit cd4c8f2

Browse files
mauriciopfsibelius
authored andcommitted
feat(RNCameraManager): expose videoStabilizationMode from native (react-native-camera#2681)
* fix(RNCameraManager) expose videoStabilizationMode from native * refactor(types): add videoStabilization to the module declaration
1 parent dea3371 commit cd4c8f2

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

ios/RN/RNCameraManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ @implementation RNCameraManager
2323
RCT_EXPORT_VIEW_PROPERTY(onPictureSaved, RCTDirectEventBlock);
2424
RCT_EXPORT_VIEW_PROPERTY(onTextRecognized, RCTDirectEventBlock);
2525
RCT_EXPORT_VIEW_PROPERTY(onSubjectAreaChanged, RCTDirectEventBlock);
26+
RCT_EXPORT_VIEW_PROPERTY(videoStabilizationMode, NSInteger);
2627

2728
+ (BOOL)requiresMainQueueSetup
2829
{

types/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ type Orientation = Readonly<{
2222
}>;
2323
type OrientationNumber = 1 | 2 | 3 | 4;
2424
type AutoFocus = Readonly<{ on: any; off: any }>;
25+
type VideoStabilization = Readonly<{off: any, standard: any, cinematic: any, auto: any}>;
2526
type FlashMode = Readonly<{ on: any; off: any; torch: any; auto: any }>;
2627
type CameraType = Readonly<{ front: any; back: any }>;
2728
type WhiteBalance = Readonly<{
@@ -127,6 +128,7 @@ export interface Constants {
127128
portrait: 'portrait';
128129
portraitUpsideDown: 'portraitUpsideDown';
129130
};
131+
VideoStabilization: VideoStabilization;
130132
}
131133

132134
export interface RNCameraProps {
@@ -222,6 +224,7 @@ export interface RNCameraProps {
222224
} | null;
223225

224226
// -- IOS ONLY PROPS
227+
videoStabilizationMode?: keyof VideoStabilization;
225228
defaultVideoQuality?: keyof VideoQuality;
226229
/* if true, audio session will not be released on component unmount */
227230
keepAudioSession?: boolean;

0 commit comments

Comments
 (0)