是否可以在录制时监听timeupdate事件并获取当前时间?我使用videojs和videojs-record插件来录制视频和音频。我尝试在videojs的播放器对象上监听时间更新,但没有结果-它没有被触发
发布于 2019-04-13 21:19:17
看一看https://collab-project.github.io/videojs-record/#/recorded-data?id=timestamps
基本上使用timeSlice选项启用事件:
record: {
audio: false,
video: true,
maxLength: 5,
debug: true,
// fire the timestamp event every 2 seconds
timeSlice: 2000
}并监听时间戳事件。例如:
// monitor stream data during recording
player.on('timestamp', function() {
// timestamps
console.log('current timestamp: ', player.currentTimestamp);
console.log('all timestamps: ', player.allTimestamps);
// stream data
console.log('array of blobs: ', player.recordedData);
// or construct a single blob:
// var blob = new Blob(blobs, {
// type: 'video/webm'
// });
});https://stackoverflow.com/questions/42398912
复制相似问题