我正在开发一个关注视频应用程序,该应用程序会查看网络摄像头用户以分析用户行为,然后通过和IA分析视频期间用户的关注度。 我的问题是,我尝试在用户观看的视频结束后自动上传网络摄像头视频,但是在观看结束后找不到任何直接将其上传到Firebase的方法。
我已经尝试过直接在输入中显示我的网络摄像头视频,或者在视频结束后发送它,但是我仍然没有避免避免下载部分,我需要将文件发送到firebase片刻。
public sendArchive() {
let archive = this.dataForm.get('archive');
let reference = this.firebaseStorage.referenceArchive(this.numberArchive);
let task = this.firebaseStorage.taskCloudStorage(this.numberArchive, archive)
reference.getDownloadURL().subscribe((URL) => {
this.URLPublicated = URL;
});
}
//This is where I stock my webCam video :
this.selectedFile = this.videoService.webcamRecorder.chunks;
console.log("Test du fichier " + this.videoService.webcamRecorder.chunks );
var data =this.selectedFile;
console.log(data);
var blob = new Blob([data], { type: 'video/webm' });
console.log("Test du blob " + blob );
this.videoSend = data;
this.fileUrl = this.sanitizer.bypassSecurityTrustResourceUrl(window.URL.createObjectURL(blob));
console.log("Test de l'URL du blob " + this.fileUrl );
this.videoName = Date();
//HTML file to upload the webCamVideo
<div class="contenedor">
<div class="contenedor_formulario">
<h1 class="is-size-1">Send Datas to Firebase</h1>
<a [href]="fileUrl" download="{{ videoName }}" type="video/webm">Download And send the vidéo</a>
<form [formGroup]="archiveForm" (ngSubmit)="sendArchive()">
<div class="file has-name is-boxed">
<label class="file-label">
<input class="file-input" type="file" ng-model="videoName" formControlName="archiveForm" (change)="prepareArchive($event)" >
</label>
</div>
<hr>
<progress *ngIf="percentage > 0 && percentage < 100" class="progress is-large is-success" value="{{percentage}}" max="100">{{percentage}}%</progress>
<button [ngClass]="{'button': true, 'is-success': true, 'is-large': true, 'is-loading': percentage > 0 && percentage < 100}" [disabled]="!archiveForm.valid && (percentage > 0 && percentage < 100)">Send The video</button>
</form>
</div>
</div>
目前,在视频播放完毕后,当我想自动将其上传到Firebase时,我只能通过输入上传文件!