test/integration/integ_player_bab_ldt.html
changeset 952 693c282aa4e9
parent 951 13fed6c21d51
child 953 b58eda0ce5df
equal deleted inserted replaced
951:13fed6c21d51 952:693c282aa4e9
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
       
     2 <html xmlns="http://www.w3.org/1999/xhtml" lang="fr" xml:lang="fr">
       
     3 	<head>
       
     4 		<title>player_bab_ldt</title>
       
     5 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
       
     6 		<style type="text/css" media="screen">
       
     7 		html, body { height:100%; background-color: #990000;}
       
     8 		body { margin:0; padding:0; overflow:hidden; }
       
     9 		#flashContent { width:600px; height:420px; }
       
    10 		</style>
       
    11 		<script>
       
    12 		
       
    13 var player   = null;
       
    14 var output   = null;
       
    15 var progress = null;
       
    16 
       
    17 
       
    18 function onBabPlayerReady(message)
       
    19 {
       
    20     player_p = document.getElementById("player_bab_ldt");
       
    21 	player   = player_p.getElementsByTagName("embed")[0];
       
    22     output   = document.getElementById('demo_output');
       
    23     progress = document.getElementById('demo_progress');
       
    24 	
       
    25     output_send('Player is ready !');
       
    26 }
       
    27 function onBabStateChange(t){
       
    28 	// States can be : seeking (3), paused (2), playing (1)
       
    29 	//output_send("state = " + t);
       
    30 }
       
    31 function onBabVideoProgress(data)
       
    32 {
       
    33     progress.value = 'mediaTime: ' + data.mediaTime + ' s';
       
    34 }
       
    35 
       
    36 function output_send(message)
       
    37 {
       
    38     if (output)
       
    39     {
       
    40         output.value += "\n"+ message;
       
    41         output.scrollTop = output.scrollHeight;
       
    42     }
       
    43 }
       
    44 // External interface functions
       
    45 function player_playVideo(){
       
    46     if (player){
       
    47         player.playVideo();
       
    48         //output_send('call method: playVideo()');
       
    49     }
       
    50 }
       
    51 function player_pauseVideo(){
       
    52     if (player){
       
    53         player.pauseVideo();
       
    54         //output_send('call method: pauseVideo()');
       
    55     }
       
    56 }
       
    57 function player_getCurrentTime(){
       
    58     if (player){
       
    59         var value = player.getCurrentTime();
       
    60         output_send('call method: getCurrentTime() à ' + value);
       
    61     }
       
    62 }
       
    63 function player_seekTo(){
       
    64     if (player){
       
    65         var time = Math.floor(Math.random() * 100);
       
    66         //player.seekTo(time);
       
    67         player.seekTo(51);
       
    68         //output_send('call method: seekTo(' + time + ')');
       
    69     }
       
    70 }
       
    71 function player_isMuted(){
       
    72     if (player){
       
    73         var value = player.isMuted();
       
    74         output_send('call method: isMuted() à ' + value);
       
    75     }
       
    76 }
       
    77 function player_mute(){
       
    78     if (player){
       
    79         player.mute();
       
    80         //output_send('call method: mute()');
       
    81     }
       
    82 }
       
    83 function player_unMute(){
       
    84     if (player){
       
    85         player.unMute();
       
    86         //output_send('call method: unMute()');
       
    87     }
       
    88 }
       
    89 function player_setVolume(){
       
    90     if (player){
       
    91 		// Entre 0 et 2
       
    92 		var volume = Math.random() * 2;
       
    93         player.setVolume(volume);
       
    94         output_send('call method: setVolume( ' + volume + ' )');
       
    95     }
       
    96 }
       
    97 function player_getVolume(){
       
    98     if (player){
       
    99         var value = player.getVolume();
       
   100         output_send('call method: getVolume() à ' + value);
       
   101     }
       
   102 }
       
   103 function player_playInstruction(){
       
   104     if (player){
       
   105         var value = Math.floor(Math.random() * 9) + 1;
       
   106         player.playInstruction(value);
       
   107         output_send('call method: player_playInstruction() à ' + value);
       
   108     }
       
   109 }
       
   110 
       
   111 		</script>
       
   112 	</head>
       
   113 	<body>
       
   114 		<div id="flashContent">
       
   115 			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="player_bab_ldt" align="middle">
       
   116 				<param name="movie" value="../../assets/player_bab_ldt/player_bab_ldt.swf" />
       
   117 				<param name="quality" value="high" />
       
   118 				<param name="bgcolor" value="#ffffff" />
       
   119 				<param name="play" value="true" />
       
   120 				<param name="loop" value="true" />
       
   121 				<param name="wmode" value="transparent" />
       
   122 				<param name="scale" value="showall" />
       
   123 				<param name="menu" value="true" />
       
   124 				<param name="devicefont" value="false" />
       
   125 				<param name="salign" value="" />
       
   126 				<param name="allowScriptAccess" value="always" />
       
   127 				<param name="allowFullScreen" value="true" />
       
   128 				<param name="flashvars" value="urlData=fichiers_bab/yeelen_bab.ldt">
       
   129 				<embed src="../../assets/player_bab_ldt/player_bab_ldt.swf" quality="high" bgcolor="#869ca7"
       
   130 					 width="500" height="375" name="ExternalInterfaceExample" align="middle"
       
   131 					 play="true" loop="false" quality="high" allowScriptAccess="always" 
       
   132 					 type="application/x-shockwave-flash" allowFullScreen"true" wmode="transparent" 
       
   133 					 flashvars="urlData=fichiers_bab/yeelen_bab.ldt"
       
   134 					 pluginspage="http://www.macromedia.com/go/getflashplayer">
       
   135          </embed>
       
   136 			</object>
       
   137 		</div>
       
   138 		<div>
       
   139 			<input type="button" class="button" onclick="javascript:player_playVideo();" value="playVideo" />
       
   140 			<input type="button" class="button" onclick="javascript:player_pauseVideo();" value="pauseVideo" />
       
   141 			<input type="button" class="button" onclick="javascript:player_getCurrentTime();" value="getCurrentTime" />
       
   142 			<input type="button" class="button" onclick="javascript:player_seekTo();" value="seekTo" />
       
   143 			<input type="button" class="button" onclick="javascript:player_isMuted();" value="isMuted" />
       
   144 			<input type="button" class="button" onclick="javascript:player_mute();" value="mute" />
       
   145 			<input type="button" class="button" onclick="javascript:player_unMute();" value="unMute" />
       
   146 			<input type="button" class="button" onclick="javascript:player_getVolume();" value="getVolume" />
       
   147 			<input type="button" class="button" onclick="javascript:player_setVolume();" value="setVolume" />
       
   148             <input type="button" class="button" onclick="javascript:player_playInstruction();" value="playInstruction" />
       
   149 			<br/><textarea id="demo_output" rows="10" style="width:500px;"></textarea><textarea id="demo_progress" >bla</textarea>
       
   150 		</div>
       
   151 	</body>
       
   152 </html>