// video.js configuration
this.config = {
controls: false,
bigPlayButton: false,
loop: false,
width: 640,
height: 480,
fluid: false,
plugins: {
record: {
screen: true,
image:true,
maxLength: 30,
displayMilliseconds: false,
debug: true,
}
}
};
async getVPDetails(): Promise<any> {
return await this.player.record().exportImage('image/png', 1);
}
takeScreenshot(){
this.getVPDetails().then(data => {
var unsafeImageUrl = URL.createObjectURL(data);
this.imageData = this.sanitizer.bypassSecurityTrustUrl(unsafeImageUrl);
}, error => {
console.log(error);
});
}
这是我用来截取屏幕截图(整个窗口)的代码,但是我从这个函数获取的图像中显示的质量非常低, 有人可以帮我提高它的质量。使用的库:https ://collab-project.github.io/videojs-record/#/