cordova-plugin-camera icon indicating copy to clipboard operation
cordova-plugin-camera copied to clipboard

iOS 14 shows PHOTO when selecting VIDEO media type

Open haimomesi opened this issue 3 years ago • 2 comments

Bug Report

When selecting video from camera source, the opened screen only shows PHOTO option and no video recording option.

What is expected to happen?

Should allow video capture

What does actually happen?

only shows photo capture

Information

Command or Code

const options: CameraOptions = {
    destinationType: this.camera.DestinationType.FILE_URI,
    cameraDirection: this.camera.Direction.FRONT,
    mediaType: this.camera.MediaType.VIDEO,
    sourceType: this.camera.PictureSourceType.CAMERA
  }

const video = await this.camera.getPicture(options);

Environment, Platform, Device

iOS 14.4 and iOS 14.5 beta

Version information

ionic 6.12.4 @capacitor/core: 2.4.6 @angular.core: 11.1.1 Xcode 12.5 @ionic-native/camera: 5.31.1 cordova-plugin-camera: 5.0.1

Checklist

  • [ ] I searched for existing GitHub issues
  • [ ] I updated all Cordova tooling to most recent version
  • [ ] I included all the necessary information above

haimomesi avatar Feb 15 '21 12:02 haimomesi

I have the same problem, it's a problem that when camera as sourceType is selected, only images are allowed: https://github.com/apache/cordova-plugin-camera/blob/bf12b39d185da0478250c0b7e1b217ee1d760d31/src/ios/CDVCamera.m#L735-L745

Siedlerchr avatar Jan 12 '22 10:01 Siedlerchr

It's doing exactly the same for me on both iOS (14.4) and Android (11) - videos can be picked from the gallery, but only photos can be taken.

calculusdev avatar May 17 '22 09:05 calculusdev

It’s the documented behavior

https://github.com/apache/cordova-plugin-camera#cameracameraoptions--object

Set the type of media to select from. Only works when PictureSourceType is PHOTOLIBRARY or SAVEDPHOTOALBUM.

jcesarmobile avatar Sep 14 '22 21:09 jcesarmobile

@jcesarmobile Well. I changed the plugin to do this in my fork. I see no reason why this should not be allowed.

https://github.com/safetyinnovation/cordova-plugin-camera/commit/08d215f4e0ed3a280e84cbc7128338884541ca90

Siedlerchr avatar Sep 14 '22 21:09 Siedlerchr