upload image as video on publication solved

This commit is contained in:
Equilibrium ITO
2024-03-11 16:05:59 +01:00
parent c49cd411e3
commit 689a6299cc
2 changed files with 30 additions and 36 deletions
@@ -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() {
+1 -1
View File
@@ -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",