mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
upload image as video on publication solved
This commit is contained in:
@@ -278,42 +278,36 @@ export class NewPublicationPage implements OnInit {
|
||||
}
|
||||
|
||||
async loadVideo() {
|
||||
|
||||
const result = await FilePicker.pickMedia
|
||||
({
|
||||
multiple: true,
|
||||
});
|
||||
const result = await FilePicker.pickMedia ({ multiple: true, });
|
||||
console.log(result.files)
|
||||
result.files.forEach(async element => {
|
||||
|
||||
this.filesSizeSum = this.filesSizeSum + element.size
|
||||
if (this.fileSizeToMB(this.filesSizeSum) <= 20) {
|
||||
console.log('pass size verificartion')
|
||||
if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') {
|
||||
let resultUrl = decodeURIComponent(element.path);
|
||||
console.log('pass type verification ', resultUrl)
|
||||
|
||||
try {
|
||||
|
||||
if(this.platform.is('ios')) {
|
||||
this.recordevideoIos(resultUrl)
|
||||
} else {
|
||||
this.loadVideoAndroid(resultUrl,element)
|
||||
}
|
||||
|
||||
if (this.checkFileType.checkFileType(element.mimeType) == 'video' && this.platform.is('ios')) {
|
||||
let resultUrl = decodeURIComponent(element.path); console.log('pass type verification ', resultUrl)
|
||||
try {
|
||||
this.recordevideoIos(resultUrl)
|
||||
} catch (error) {
|
||||
console.log('upload video error: ', error)
|
||||
}
|
||||
} else if (this.checkFileType.checkFileType(element.mimeType) == 'image' || this.checkFileType.checkFileType(element.mimeType) == 'video') {
|
||||
let resultUrl = decodeURIComponent(element.path);
|
||||
console.log('pass type verification ', resultUrl)
|
||||
try {
|
||||
this.loadVideoAndroid(resultUrl,element)
|
||||
} catch (error) {
|
||||
console.log('upload video error: ', error)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.seletedContent.length === 0)
|
||||
this.filesSizeSum = 0
|
||||
|
||||
this.httpErrorHandle.validationMessagge('filessize')
|
||||
}
|
||||
} else {
|
||||
if (this.seletedContent.length === 0)
|
||||
this.filesSizeSum = 0
|
||||
|
||||
this.httpErrorHandle.validationMessagge('filessize')
|
||||
}
|
||||
});
|
||||
};
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
chossePhotoOrVideo() {
|
||||
|
||||
@@ -68,7 +68,7 @@ export class AttachmentsService {
|
||||
|
||||
downloadFile(guid: any) {
|
||||
|
||||
let downloadUrl = environment.apiURL + 'objectserver/streamfiles?path=' + guid;
|
||||
let downloadUrl = environment.apiURL + 'objectserver/StreamChatFiles?path=' + guid;
|
||||
var name = new Date().getTime();
|
||||
return this.http.get(downloadUrl, {
|
||||
responseType: "arraybuffer",
|
||||
|
||||
Reference in New Issue
Block a user