test/integration/integ_player_bab_ldt.html
changeset 885 a26701464849
child 886 ab69ff6fa02b
equal deleted inserted replaced
879:85da59ccbdf8 885:a26701464849
       
     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.innerHTML = '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() * 10);
       
    66         player.seekTo(time);
       
    67         //output_send('call method: seekTo(' + time + ')');
       
    68     }
       
    69 }
       
    70 function player_isMuted(){
       
    71     if (player){
       
    72         var value = player.isMuted();
       
    73         output_send('call method: isMuted() à ' + value);
       
    74     }
       
    75 }
       
    76 function player_mute(){
       
    77     if (player){
       
    78         player.mute();
       
    79         //output_send('call method: mute()');
       
    80     }
       
    81 }
       
    82 function player_unMute(){
       
    83     if (player){
       
    84         player.unMute();
       
    85         //output_send('call method: unMute()');
       
    86     }
       
    87 }
       
    88 function player_setVolume(){
       
    89     if (player){
       
    90 		// Entre 0 et 2
       
    91 		var volume = Math.random() * 2;
       
    92         player.setVolume(volume);
       
    93         output_send('call method: setVolume( ' + volume + ' )');
       
    94     }
       
    95 }
       
    96 function player_getVolume(){
       
    97     if (player){
       
    98         var value = player.getVolume();
       
    99         output_send('call method: getVolume() à ' + value);
       
   100     }
       
   101 }
       
   102 
       
   103 		</script>
       
   104 	</head>
       
   105 	<body>
       
   106 		<div id="flashContent">
       
   107 			<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="player_bab_ldt" align="middle">
       
   108 				<param name="movie" value="../../assets/player_bab_ldt/player_bab_ldt.swf" />
       
   109 				<param name="quality" value="high" />
       
   110 				<param name="bgcolor" value="#ffffff" />
       
   111 				<param name="play" value="true" />
       
   112 				<param name="loop" value="true" />
       
   113 				<param name="wmode" value="transparent" />
       
   114 				<param name="scale" value="showall" />
       
   115 				<param name="menu" value="true" />
       
   116 				<param name="devicefont" value="false" />
       
   117 				<param name="salign" value="" />
       
   118 				<param name="allowScriptAccess" value="always" />
       
   119 				<param name="allowFullScreen" value="true" />
       
   120 				<param name="flashvars" value="urlData=fichiers_bab/yeelen_bab.ldt&urlSkin=fichiers_bab/SkinBoutABout.swf">
       
   121 				<embed src="../../assets/player_bab_ldt/player_bab_ldt.swf" quality="high" bgcolor="#869ca7"
       
   122 					 width="500" height="375" name="ExternalInterfaceExample" align="middle"
       
   123 					 play="true" loop="false" quality="high" allowScriptAccess="always" 
       
   124 					 type="application/x-shockwave-flash" allowFullScreen"true" wmode="transparent" 
       
   125 					 flashvars="urlData=fichiers_bab/yeelen_bab.ldt&urlSkin=fichiers_bab/SkinBoutABout.swf"
       
   126 					 pluginspage="http://www.macromedia.com/go/getflashplayer">
       
   127          </embed>
       
   128 			</object>
       
   129 		</div>
       
   130 		<div>
       
   131 			<input type="button" class="button" onclick="javascript:player_playVideo();" value="playVideo" />
       
   132 			<input type="button" class="button" onclick="javascript:player_pauseVideo();" value="pauseVideo" />
       
   133 			<input type="button" class="button" onclick="javascript:player_getCurrentTime();" value="getCurrentTime" />
       
   134 			<input type="button" class="button" onclick="javascript:player_seekTo();" value="seekTo" />
       
   135 			<input type="button" class="button" onclick="javascript:player_isMuted();" value="isMuted" />
       
   136 			<input type="button" class="button" onclick="javascript:player_mute();" value="mute" />
       
   137 			<input type="button" class="button" onclick="javascript:player_unMute();" value="unMute" />
       
   138 			<input type="button" class="button" onclick="javascript:player_getVolume();" value="getVolume" />
       
   139 			<input type="button" class="button" onclick="javascript:player_setVolume();" value="setVolume" />
       
   140 			<br/><textarea id="demo_output" rows="10" style="width:500px;"></textarea><textarea id="demo_progress" >bla</textarea>
       
   141 		</div>
       
   142 	</body>
       
   143 </html>