шагов, которые будут воспроизводить проблему: Я записываю видео с помощью камеры моего устройства с использованием recordRT C, сохраняю и загружаю записанное видео. После загрузки записанного видео я слышу только звук, но не вижу его на своем устройстве ipad / windows 10. (Предполагается, что формат видео webm не поддерживается.)
initMediaRecorder(mediaStream: MediaStream) {
this.mediaRecorder = new window['MediaRecorder'](mediaStream, mimeType: 'video/webm');
const recordedChunks = [];
// zone.js doesn't patch mediaRecorder
// to make change detection work the callback has to be executed inside a zone
this.mediaRecorder.ondataavailable = e => {
this._zone.run(() => {
if (e.data.size > 0) {
recordedChunks.push(e.data);
}
});
};
this.mediaRecorder.onstop = () => {
this._zone.run(() => {
this.isRecordingVideo = false;
this.recordedVideo = new Blob(recordedChunks, { type: 'video/webm'});
this.letGoOffCamera();
this.isPreviewing = true;
this.liveFeedElement.nativeElement.srcObject = null;
this.liveFeedElement.nativeElement.src = URL.createObjectURL(this.recordedVideo);
this.liveFeedElement.nativeElement.muted = false;
this.liveFeedElement.nativeElement.controls = true;
this.isRecordingVideoPaused = false;
this.videoRecordEnded = true;
});
};
this.mediaRecorder.onstart = () => this._zone.run(() => this.isRecordingVideo = true,
this.isRecordingVideoPaused = false);
/**
* onpause();
* onResume();
*/
this.mediaRecorder.onpause = () => {
this._zone.run(() => {
this.isRecordingVideoPaused = true;
this.isRecordingVideo = false;
console.log("recordedChunks", recordedChunks);
this.recordedVideo = new Blob(recordedChunks, { type: 'video/webm' });
this.isPreviewing = true;
this.liveFeedElement.nativeElement.src = URL.createObjectURL(this.recordedVideo);
});
};
this.mediaRecorder.onresume = () => this._zone.run(() => this.isRecordingVideoPaused = false,
this.isRecordingVideo = true);
}
Каков ожидаемый результат?
Для загрузки ответа, получаемого как Content-Type: application / octet-stream на локальном компьютере (ipad / windows) и воспроизводить его с помощью приложений
getDocumentToShow(blobObj){
this.service.getDocument(url,blobObj).subscribe((data:any)=>{
var blob = new Blob([data], {type: "octet/stream"});
this.objectUrl = URL.createObjectURL(blob);
//followed by creating a anchor tag and downloading it
})
}
Вот формат ответа от службы: ![enter image description here](https://i.stack.imgur.com/lTlI9.png)
Что происходит вместо этого?
может загрузить файл как видео video.webm , но при попытке воспроизвести файл, который не показывает видео, но может слышать записанный звук