Merge pull request #1452 from dpalou/MOBILE-2536

MOBILE-2536 ios: Fix record media in iOS
main
Juan Leyva 2018-08-21 17:04:19 +01:00 committed by GitHub
commit 424ad0b13d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -458,14 +458,19 @@ export class CoreFileUploaderHelperProvider {
// The mimetypes param is only for desktop apps, the Cordova plugin doesn't support it.
return promise.then((medias) => {
// We used limit 1, we only want 1 media.
const media: MediaFile = medias[0],
path = media.fullPath,
error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported.
const media: MediaFile = medias[0];
let path = media.fullPath;
const error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported.
if (error) {
return Promise.reject(error);
}
// Make sure the path has the protocol. In iOS it doesn't.
if (path.indexOf('file://') == -1) {
path = 'file://' + path;
}
if (upload) {
return this.uploadFile(path, maxSize, true, this.fileUploaderProvider.getMediaUploadOptions(media));
} else {