view johndyer-mediaelement-13fa20a/demo/mediaelement.html @ 25:4a4bd554b4c1 tip

Closing this sub branch.
author Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk>
date Mon, 25 Mar 2013 14:02:54 +0000
parents 032bc65ebafc
children
line wrap: on
line source
<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>HTML5 MediaElement</title>	
		
	<script src="../build/mediaelement.js"></script>
</head>
<body>

<h1>MediaElement.js</h1>

<p>This is only the Flash/Silverlight Shim for older browers or browsers without the codec you need. It is not a full player.</p>

<h2>MP4 video (as src)</h2>
<video width="360" height="203" id="player1" src="../media/echo-hereweare.mp4" type="video/mp4" controls="controls"></video>

<input type="button" id="pp" value="toggle" />
<span id="time"></span>
	
<script>
MediaElement('player1', {success: function(me) {
	
	me.play();
	
	me.addEventListener('timeupdate', function() {
		document.getElementById('time').innerHTML = me.currentTime;
	}, false);
	
	document.getElementById('pp')['onclick'] = function() {
		if (me.paused)
			me.play();
		else
			me.pause();
	};

}});
</script>

</body>
</html>