diff --git a/README.md b/README.md index 8030aad..9c80d57 100644 --- a/README.md +++ b/README.md @@ -164,7 +164,7 @@ On Android, the tag must be a local image or video URI, such as `"file:///sdcard On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs) or a local video file URI (remote or data URIs are not supported for saving video at this time). -If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise it will be treated as a photo. To override the automatic choice, you can pass an optional `type` parameter that must be one of 'photo' or 'video'. +If the tag has a file extension of .mov or .mp4 (lower or uppercase), it will be inferred as a video. Otherwise it will be treated as a photo. To override the automatic choice, you can pass an optional `type` parameter that must be one of 'photo' or 'video'. It allows to specify a particular album you want to store the asset to when the param `album` is provided. On Android, if no album is provided, DCIM directory is used, otherwise PICTURE or MOVIES directory is used depending on the `type` provided. diff --git a/src/CameraRoll.ts b/src/CameraRoll.ts index b0769c6..684945a 100644 --- a/src/CameraRoll.ts +++ b/src/CameraRoll.ts @@ -178,7 +178,7 @@ export class CameraRoll { if (type === 'auto') { const fileExtension = tag.split('.').slice(-1)[0] ?? ''; - if (['mov', 'mp4'].indexOf(fileExtension) >= 0) type = 'video'; + if (['mov', 'mp4'].indexOf(fileExtension.toLowerCase()) >= 0) type = 'video'; else type = 'photo'; } return RNCCameraRoll.saveToCameraRoll(tag, {type, album});