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