fix: Make videoCodec clearly iOS only

This commit is contained in:
Marc Rousavy 2021-12-31 12:33:21 +01:00
parent 5bbe2bfbab
commit dd7fc0880e
2 changed files with 4 additions and 0 deletions

View File

@ -245,8 +245,11 @@ export class Camera extends React.PureComponent<CameraProps> {
* 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<CameraVideoCodec[]> {
if (Platform.OS !== 'ios') return []; // no video codecs supported on other platforms.
try {
return await CameraModule.getAvailableVideoCodecs(this.handle, fileType);
} catch (e) {

View File

@ -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;
}