mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
video merge
This commit is contained in:
@@ -56,33 +56,35 @@
|
||||
<ion-img *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'image'"
|
||||
name="image" ngDefaultControl [src]="seleted.FileBase64" style="height: 69px;"></ion-img>
|
||||
|
||||
<div *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && seleted.chucksManager" style="background: #ededed;">
|
||||
|
||||
|
||||
<!-- <div class="progress-container" *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
|
||||
<div class="progress-bar" id="myProgressBar"></div>
|
||||
</div> -->
|
||||
|
||||
<!-- <div *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video'">
|
||||
<mat-progress-bar
|
||||
|
||||
mode="determinate"
|
||||
[style.width]="seleted.chucksManager.uploadPercentage"
|
||||
></mat-progress-bar>
|
||||
|
||||
</div>
|
||||
*ngIf="seleted.chucksManager"
|
||||
mode="determinate"
|
||||
style="width: 50%"
|
||||
></mat-progress-bar>
|
||||
</div> -->
|
||||
|
||||
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkDesktop() == true" width="70" height="70"
|
||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="seleted.url">
|
||||
<source type="video/mp4" [src]="seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
<ion-icon *ngIf="seleted?.chucksManager?.manualRetry" src="assets/images/retry-svgrepo-com.svg" class="icon-download font-12"> </ion-icon>
|
||||
<video *ngIf="checkFileType.checkFileType(seleted.FileExtension) == 'video' && checkTableDivice() == true" width="70" height="70"
|
||||
preload="metadata" webkit-playsinline="webkit-playsinline">
|
||||
<source type="video/mp4" [src]="seleted.FileBase64">
|
||||
</video>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- Display the blurred image and count if there are more images -->
|
||||
<div *ngIf="seletedContent.length > displayLimit" lot="start">
|
||||
<ion-img [src]="'data:image/jpg;base64,' + seletedContent[displayLimit - 1].Base64"
|
||||
style="filter: blur(5px);"></ion-img>
|
||||
|
||||
<p>mais {{ seletedContent.length - displayLimit }}</p>
|
||||
</div>
|
||||
|
||||
<ion-label class="pl-10">
|
||||
<p>{{capturedImageTitle}}</p>
|
||||
@@ -144,6 +146,10 @@
|
||||
</div>
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<video id="yourVideoElementId" >videoss</video>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user