From dd7fc0880e38cfb06a5e5e1e0a0c4d7e07418ccc Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 31 Dec 2021 12:33:21 +0100 Subject: [PATCH] fix: Make `videoCodec` clearly iOS only --- src/Camera.tsx | 3 +++ src/VideoFile.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/Camera.tsx b/src/Camera.tsx index 55655a2..8551d80 100644 --- a/src/Camera.tsx +++ b/src/Camera.tsx @@ -245,8 +245,11 @@ export class Camera extends React.PureComponent { * const codecs = await camera.current.getAvailableVideoCodecs("mp4") * ``` * @throws {@linkcode CameraRuntimeError} When any kind of error occured while getting available video codecs. Use the {@linkcode ParameterError.code | code} property to get the actual error + * @platform iOS */ public async getAvailableVideoCodecs(fileType?: VideoFileType): Promise { + if (Platform.OS !== 'ios') return []; // no video codecs supported on other platforms. + try { return await CameraModule.getAvailableVideoCodecs(this.handle, fileType); } catch (e) { diff --git a/src/VideoFile.ts b/src/VideoFile.ts index 57a31da..56d003d 100644 --- a/src/VideoFile.ts +++ b/src/VideoFile.ts @@ -37,6 +37,7 @@ export interface RecordVideoOptions { * To get a list of all available video codecs use the `getAvailableVideoCodecs()` function. * * @default undefined + * @platform iOS */ videoCodec?: CameraVideoCodec; }