cordova-plugin-camera
cordova-plugin-camera copied to clipboard
iOS 14 shows PHOTO when selecting VIDEO media type
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
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
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.
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 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