1In HTML Document:
2<video width='500' height='150'
3 onmouseenter='VideoController(true, this)'
4 onmouseleave='VideoController(false, this)'
5 src="Videos/test.webm" loop>
6 Your browser does not support the video tag.
7</video>
8
9In CSS:
10const VideoController = function(isHovering, videoElement)
11{
12 if (isHovering == true)
13 {
14 videoElement.play();
15 }
16 else if (isHovering == false)
17 {
18 videoElement.pause();
19 }
20}