summaryrefslogtreecommitdiff
path: root/extensions/TimedMediaHandler/MwEmbedModules/EmbedPlayer/tests/Player_ServerSeek.html
blob: 6a9d7d044dc0793c096cf2237f155f8bfb32f678 (plain)
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
31
32
33
34
35
<html>
  <head>
    <script type="text/javascript" src="../../../mwEmbedStartup.php"></script>
  </head>
  <body>
    <h2>mwEmbed / archive.org server side seek</h2>
	Start Playing at <input id="startTime" size="5" value="50"></input> seconds. <input value="go" type="button" id="doPageSeek"></input></br> 	
    <video id="vid1" poster="http://www.archive.org/download/night_of_the_living_dead/format=Thumbnail&x.jpg"
           style="width:400px;height:300px" durationHint="5717.21">
      <source URLTimeEncoding='true' src="http://www.archive.org/download/night_of_the_living_dead/night_of_the_living_dead_512kb.mp4"/>
      <source URLTimeEncoding='true' src="http://www.archive.org/download/night_of_the_living_dead/night_of_the_living_dead.ogv"/>
    </video>
    <script type="text/javascript">
    	mw.ready( function(){
        	// check for hash:
        	var urlParts = new mw.Uri( document.URL);
        	if( urlParts.anchor ){
				// run the start offset:
				var startTime = urlParts.anchor.split('=')[1];

				//update the input box:
				$j('#startTime').val( startTime );
				
				// update current time then play: 
				$j('#vid1')[0].currentTime = startTime;
				$j('#vid1')[0].play();
        	}
    		// bind button: 
    		$j('#doPageSeek').click(function(){        		
        		document.location = 'Player_ServerSeek.html?' + Math.random(1) + '#start=' + $j("#startTime").val();
    		});
    	});
    </script>
  </body>
</html>