出于安全要求,我的项目已被 Sonatype Nexus Lifecycle 扫描。通过密钥代码得出两个问题: 在此输入图片描述
那么,请问是否可以删除videojs8中的键码? 如果是的话,请问我该如何删除?
是的,可以删除
KeyCode
。试试这个:
const player = videojs('my-video');
player.on('keydown', (event) => {
if (event.which === 32) { // 32 for Space key
// Handle space key press
} else if (event.which === 13) { // 13 for Enter key
// Handle enter key press
}
});
在这里,Video.js 提供的
keydown
事件用于监听按键。
您还可以查看:如何监听视频标签中的 keydown 事件?