Skip to content
This repository was archived by the owner on Jun 16, 2023. It is now read-only.

Commit f925225

Browse files
author
Felipe Constantino
committed
feat(types): update types for video recording codec
1 parent 3daea5d commit f925225

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

types/index.d.ts

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type CameraType = { front: any, back: any };
1818
type WhiteBalance = { sunny: any, cloudy: any, shadow: any, incandescent: any, fluorescent: any, auto: any };
1919
type BarCodeType = { aztec: any, code128: any, code39: any, code39mod43: any, code93: any, ean13: any, ean8: any, pdf417: any, qr: any, upce: any, interleaved2of5: any, itf14: any, datamatrix: any };
2020
type VideoQuality = { '2160p': any, '1080p': any, '720p': any, '480p': any, '4:3': any };
21+
type VideoCodec = { 'H264': symbol, 'JPEG': symbol, 'HVEC': symbol, 'AppleProRes422': symbol, 'AppleProRes4444': symbol };
2122

2223
type FaceDetectionClassifications = { all: any, none: any };
2324
type FaceDetectionLandmarks = { all: any, none: any };
@@ -26,6 +27,7 @@ type FaceDetectionMode = { fast: any, accurate: any };
2627
export interface Constants {
2728
AutoFocus: AutoFocus;
2829
FlashMode: FlashMode;
30+
VideoCodec: VideoCodec;
2931
Type: CameraType;
3032
WhiteBalance: WhiteBalance;
3133
VideoQuality: VideoQuality;
@@ -142,11 +144,16 @@ interface RecordOptions {
142144
maxDuration?: number;
143145
maxFileSize?: number;
144146
mute?: boolean;
147+
148+
/** iOS only */
149+
codec?: keyof VideoCodec | VideoCodec[keyof VideoCodec];
145150
}
146151

147152
interface RecordResponse {
148153
/** Path to the video saved on your app's cache directory. */
149154
uri: string;
155+
/** iOS only */
156+
codec: VideoCodec[keyof VideoCodec];
150157
}
151158

152159
export class RNCamera extends Component<RNCameraProps & ViewProperties> {

0 commit comments

Comments
 (0)