MOBILE-2536 ios: Fix record media in iOS
parent
e6c5607463
commit
0ab2598235
|
@ -458,14 +458,19 @@ export class CoreFileUploaderHelperProvider {
|
||||||
// The mimetypes param is only for desktop apps, the Cordova plugin doesn't support it.
|
// The mimetypes param is only for desktop apps, the Cordova plugin doesn't support it.
|
||||||
return promise.then((medias) => {
|
return promise.then((medias) => {
|
||||||
// We used limit 1, we only want 1 media.
|
// We used limit 1, we only want 1 media.
|
||||||
const media: MediaFile = medias[0],
|
const media: MediaFile = medias[0];
|
||||||
path = media.fullPath,
|
let path = media.fullPath;
|
||||||
error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported.
|
const error = this.fileUploaderProvider.isInvalidMimetype(mimetypes, path); // Verify that the mimetype is supported.
|
||||||
|
|
||||||
if (error) {
|
if (error) {
|
||||||
return Promise.reject(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) {
|
if (upload) {
|
||||||
return this.uploadFile(path, maxSize, true, this.fileUploaderProvider.getMediaUploadOptions(media));
|
return this.uploadFile(path, maxSize, true, this.fileUploaderProvider.getMediaUploadOptions(media));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue