我有这两个函数:
async takeScreenShot() {
this.pauseVideo();
if (this.animations.length && !this.ended) {
this.pauseLotties()
}
this.captures.push(this.canvas.toDataURL('image/webp'));
if (!this.ended) {
setTimeout(() => {
this.takeScreenShot();
}, 500);
}
},
async pauseVideo() {
console.log("currentTime", this.video.currentTime);
console.log("duration", this.video.duration);
this.video.pause();
const oneFrame = 1 / 30;
if (this.video.currentTime + oneFrame < this.video.duration) {
this.video.currentTime += oneFrame;
} else {
this.video.play()
}
}
现在,我每500毫秒拍摄一次画布的屏幕截图。但我想使用seek事件截取屏幕截图,并承诺在完成搜索时让我知道,以便我可以截取屏幕截图。这样,它应该更有效地翻录视频,并可能更快。我该怎么做?setTimeout
慕的地8271018
慕标5832272
相关分类