在videojs中如何播放录制的视频?

时间:2019-01-02 13:12:17

标签: javascript

我正在使用该库在浏览器https://github.com/collab-project/videojs-record上录制视频

我假设这是一个流行的库,但是在浏览器上完成后如何播放录制的视频? 在“ finishRecord ”事件中,我已将数据记录为Blob类型,但下一步是什么?

更新

player.on('finishRecord', function() {
// the blob object contains the recorded data that
// can be downloaded by the user, stored on server etc.

//Here i want to play recorded video in some video html tag

//player.record().saveAs({'video': 'my-video-file-name.webm'});
console.log('finished recording: ', player.recordedData);

});

已解决

var vsrc = window.URL.createObjectURL(player.recordedData);

var video = document.getElementById('myVideoPlayer');

video.src = vsrc;
video.autoplay = true;

video.play();

0 个答案:

没有答案