video merge

This commit is contained in:
Peter Maquiran
2024-02-07 16:45:53 +01:00
parent 4c56fa819c
commit 60edd1ca01
11 changed files with 586 additions and 421 deletions
@@ -265,9 +265,9 @@ export class NewPublicationPage implements OnInit {
).then(r => r.blob()); */
/* console.log(await blob.arrayBuffer());
console.log("base64 :data:video/mp4;base64,",this.arrayBufferToBase64(await blob.arrayBuffer())) */
this.convertBlobToBase64(blobFile.blob).then((value: string) => {
@@ -445,7 +445,6 @@ export class NewPublicationPage implements OnInit {
Files: this.seletedContent,
}
this.publicationFormMV.setDataToFrom(this.publication)
const upload = await this.publicationFormMV.uploadVideosFiles()
@@ -455,10 +454,12 @@ export class NewPublicationPage implements OnInit {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
e.FileExtension = "mp4"
}
this.publicationFormMV.ObjectMergeNotification.socket.commit(e.chucksManager.path)
return e
})
console.log("this.publication.Files", this.publication.Files)
}
@@ -480,7 +481,7 @@ export class NewPublicationPage implements OnInit {
this.httpErroHandle.httpStatusHandle(error)
if (error.status == 404) {
this.PublicationFolderService.deletePost(this.publication.ProcessId, this.publication.DocumentId)
this.goBack();
//this.goBack();
}
} finally {
loader.remove()
@@ -507,7 +508,6 @@ export class NewPublicationPage implements OnInit {
Files: this.seletedContent,
}
this.publicationFormMV.setDataToFrom(this.publication)
const upload = await this.publicationFormMV.uploadVideosFiles()
@@ -519,49 +519,60 @@ export class NewPublicationPage implements OnInit {
e.Base64 = ""
}
alert("commit")
this.publicationFormMV.ObjectMergeNotification.socket.commit(e.chucksManager.path)
return e
})
}
this.publication.Files = this.publication.Files.map( (e:PublicationAttachmentEntity) => ({
FileBase64: e.Base64,
FileExtension: e.FileExtension,
OriginalFileName: e.OriginalFileName || 'foto'
}))
const loader = this.toastService.loading()
try {
this.publication.Files = this.publication.Files.map( (e:PublicationAttachmentEntity) => ({
FileBase64: e.Base64,
FileExtension: e.FileExtension,
OriginalFileName: e.OriginalFileName || 'foto'
}))
await this.publications.CreatePublication(this.publication.ProcessId, this.publication).toPromise()
if (this.publicationTitle == '1') {
} else if (this.publicationTitle == '2') {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationTitle == '3') {
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
const loader = this.toastService.loading()
try {
await this.publications.CreatePublication(this.publication.ProcessId, this.publication).toPromise()
if (this.publicationTitle == '1') {
} else if (this.publicationTitle == '2') {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationTitle == '3') {
this.httpErroHandle.httpsSucessMessagge('Editar publicação')
}
//this.goBackToViewPublications.emit();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
this.goBackToViewPublications.emit();
} catch (error) {
this.httpErroHandle.httpStatusHandle(error)
} finally {
loader.remove()
}
} else {
this.toastService._badRequest("É necessário adicionar uma imagem ou vídeo")
}
}
this.publicationFormMV.ObjectMergeNotification.close()
// this.publicationFormMV.ObjectMergeNotification.close()
}
ngOnDestroy() {
this.publicationFormMV.ObjectMergeNotification.close()
// this.publicationFormMV.ObjectMergeNotification.close()
}
close() {