js中是否有任何实用程序或方法可以在按下Windows按钮或任务栏时暂停视频播放?
<html>
<title>Video</title>
<body>
<video id="video" controls>
<source src="http://www.w3schools.com/html/mov_bbb.mp4" type="video/mp4">
</video>
</body>
<script>
var focused = true;
document.addEventListener("visibilitychange", function () {
foo = !foo;
if (!foo)
document.getElementById("video").pause();
});
</script>
</html>