有一个拼写错误和不必要的代码:
onmouseout="this.pause();this.currentTime=;">
应该是:
onmouseout="this.pause();">
应该可以了。
document.addEventListener('DOMContentLoaded', function() {
const videos = document.querySelectorAll('video');
videos.forEach(video => {
video.EventListener('mouseover', video.play);
video.EventListener('mouseout', video.pause);
});
});