-
-
Save jorgeas80/3e077b917ef6dac3a9266e4633a591d8 to your computer and use it in GitHub Desktop.
onmouseover html5 video play, mouseout pause
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
</head> | |
<body> | |
<div style="text-align:center" onmouseover="Play()" onmouseout="Pause()"> | |
<video id="video1" width="480"> | |
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" type="video/mp4" /> | |
<source src="http://clips.vorwaerts-gmbh.de/VfE_html5.ogg" type="video/ogg" /> | |
Your browser does not support HTML5 video. | |
</video> | |
</div> | |
<script type="text/javascript"> | |
var myVideo=document.getElementById("video1"); | |
function Pause() | |
{ | |
myVideo.pause(); | |
} | |
function Play() | |
{ | |
if (myVideo.paused) | |
myVideo.play(); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment