<script>
addEventListener("blur", function() {
for(const video of document.querySelectorAll("video"))
video.pause();
});
</script>
<!-- видео для примера -->
<video controls loop>
<source src="http://techslides.com/demos/sample-videos/small.webm" type="video/webm">
<source src="http://techslides.com/demos/sample-videos/small.mp4" type="video/mp4">
</video>