1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Chat xAjax</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<script type="text/javascript">
function seek(event) {
video = document.getElementById("myvideo");
video.currentTime = 10 ;
}
function play(event) {
video = document.getElementById("myvideo");
video.play() ;
}
</script>
<center><video src="video.ogg" id="myvideo" width="640" height="480" autobuffer></video></center><br>
<script type="text/javascript">
var video = document.getElementById("myvideo");
video.addEventListener("canplaythrough", play , false);
video.addEventListener("play", seek , false);
video.addEventListener('ended', function () { alert('video playback finished') } );
</script>
</body>
</html> |