Hi everybody,
I use Cordova-plugin-file to get video from my device. Everything work perfectly on Android. but in iOS, the file got type = null after the video is compressed on iOS device. Here is my option for the file plugin:
var options = {
quality: 100,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
mediaType: Camera.MediaType.VIDEO,
saveToPhotoAlbum: false
};
then use it like this:
$cordovaCamera.getPicture(options).then(function(imageURI){
// file object
var file = {};
window.resolveLocalFileSystemURL(imageURI, function(fileEntry) {
fileEntry.file(function(fileObj) {
file = fileObj;
console.log(file.type);
});
}, function(err) {
console.log(err);
});
});
It seems weird when the video still gets compressed when I choose quality: 100 but I still can accept that. But after being compressed, the file type is not defined (on Android it is still defined as ‘video/mp4’)
How could I resolved this ? Thank you.