web/music-the-end-etc.html
author ymh <ymh.work@gmail.com>
Tue, 22 Jan 2013 13:18:26 +0100
changeset 97 3f75cc00d6da
parent 94 873b0e9ff7f6
permissions -rw-r--r--
Version theeend 1.19
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     1
<!DOCTYPE html>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     2
<html lang="fr">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     3
	<head>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     4
		<meta charset="utf-8">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     5
		<title>The End - @todo</title>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     6
		
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     7
		<meta name="description" content="@todo">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     8
		<link rel="icon" href="static/res/img/favicon.ico" />		
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
     9
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    10
		<!-- Mobile Specific Metas -->		
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    11
		<meta name="viewport" content="user-scalable=no">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    12
		<!--
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    13
		<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    14
		-->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    15
		
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    16
		<!-- Test Smartphone  -->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    17
	    <script src="static/res/js/incdetectmobile.js"></script>        
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    18
		<script>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    19
			if (IsSmartphone()) { location.href = "mindex.html"; }	
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    20
		</script>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    21
		<!-- Metanav FranceTV 	-->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    22
		<script src="http://static.francetv.fr/js/jquery.metanav-min.js" charset="utf-8"></script>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    23
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    24
		<link rel="stylesheet" href="static/res/css/style_1024.css" />
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    25
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    26
	</head>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    27
	<body>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    28
		<!-- div content - site takes the full height of browser -->			
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    29
		<div id="content" class="full_hightScreen">
94
873b0e9ff7f6 update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 92
diff changeset
    30
			<div class="boxReturn">	
873b0e9ff7f6 update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 92
diff changeset
    31
	       		<button class="btnReturn" onClick="location.href='the-end-etc.html';">Retour</button>  
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    32
			</div>
94
873b0e9ff7f6 update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 92
diff changeset
    33
			
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    34
			<!--this div empty allows the element content_vcentering to be vertically aligned -->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    35
			<section  id="intMusic" class="full_hightScreen">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    36
				<div class="strut"></div><!--
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    37
				this comment corrects the white-space (display: inline);
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    38
				--><div id="bg_img" class="fullScreen_vcentering">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    39
		    		<img id="bgimage" alt="The End, etc." src="static/res/img/choixMusique1.jpg" />
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    40
				</div>	
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    41
			</section>	
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    42
			<section id="playerAudio" class="positionAbs">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    43
				<!--this div empty allows the element content_vcentering to be vertically aligned -->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    44
				<div class="strut"></div><!--
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    45
				this comment corrects the white-space (display: inline);
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    46
				--><div class="fullScreen_vcentering white big_txt">
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    47
					<article class="boxAudio">
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
    48
						<audio id="audio1" preload="metadata">
88
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    49
							<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.ogg" type="audio/ogg">
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    50
  							<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.mp3" type="audio/mpeg">
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    51
							<p>Audio non supportée </p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    52
						</audio>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    53
						<button id="playpause1" onClick="play(1)" class="btnPlayPause txt_hidden">Play</button>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    54
		                
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    55
		                <!-- class="txt_white" can be used to color current time in white -->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    56
		                <p id="current1" class="time">0'00''</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    57
		   				<p id="title1">LA MARSEILLAISE</p><br>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    58
						
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    59
						
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
    60
						<audio id="audio2" preload="metadata">
88
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    61
							<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.ogg" type="audio/ogg">
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    62
  							<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.mp3" type="audio/mpeg">
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    63
							<p>Audio non supportée </p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    64
						</audio>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    65
						<button id="playpause2" onClick="play(2)" title="play" class="btnPlayPause txt_hidden">Play</button>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    66
		                
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    67
		                <p id="current2" class="time">0'00''</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    68
						<p id="title2">L'IDÉE</p><br>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    69
						
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
    70
						<audio id="audio3" preload="metadata">
88
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    71
							<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.ogg" type="audio/ogg">
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    72
  							<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.mp3" type="audio/mpeg">
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    73
							<p>Audio non supportée </p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    74
						</audio>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    75
						<button id="playpause3" onClick="play(3)" title="play" class="btnPlayPause txt_hidden">Play</button>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    76
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    77
		                <p id="current3" class="time">0'00''</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    78
		   				<p id="title3">L'INTERNATIONALE</p><br>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    79
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
    80
						<audio id="audio4" preload="metadata">
88
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    81
							<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.ogg" type="audio/ogg">
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    82
  							<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.mp3" type="audio/mpeg">
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    83
							<p>Audio non supportée </p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    84
						</audio>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    85
						<button id="playpause4" onClick="play(4)" title="play" class="btnPlayPause txt_hidden">Play</button>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    86
		               	<p id="current4" class="time">0'00''</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    87
		   				<p id="title4">NI DIEU NI MAÃŽTRE</p><br>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    88
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
    89
						<audio id="audio5" preload="metadata">
88
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    90
	   						<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.ogg" type="audio/ogg">
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 80
diff changeset
    91
  							<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.mp3" type="audio/mpeg">
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    92
							<p>Audio non supportée </p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    93
						</audio>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    94
						<button id="playpause5" onClick="play(5)" title="play" class="btnPlayPause txt_hidden">Play</button>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    95
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    96
		               	<p id="current5" class="time">0'00''</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    97
		   				<p id="title5">L'ENVERS DU ZÉBU</p>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    98
		   			</article>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
    99
				</div>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   100
			</section>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   101
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   102
		</div>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   103
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   104
		<!-- JavaScript -->
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   105
        <script src="static/res/js/jquery-1.8.2.min.js"></script>        		
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   106
        <script>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   107
            var playingIndex = -1;
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   108
            var loading = false;
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   109
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   110
            var play = function(audioIndex) {
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   111
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   112
            	if (loading) {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   113
            		return;
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   114
            	}
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   115
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   116
            	var wasPlaying = playingIndex;
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   117
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   118
            	// Stop the current played audio ?
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   119
            	if (playingIndex !== -1 ) {
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   120
	            	var audioObj = $("#audio" + playingIndex);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   121
	            	var audio = audioObj.get(0);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   122
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   123
					// Unbind all events
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   124
					audioObj.unbind("canplaythrough");
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   125
					audioObj.unbind("timeupdate");
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   126
					audioObj.unbind("ended");
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   127
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   128
            		// Pause the audio
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   129
	            	audio.pause();
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   130
	            	setTimeValue(0);
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   131
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   132
            		// Change the button pause in play
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   133
            		$("#playpause" + playingIndex).css({"background-position" : '0 0'});
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   134
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   135
            		// Change the title color
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   136
					$("#title" + playingIndex).removeClass("gris");	
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   137
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   138
            		playingIndex = -1;
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   139
            	}
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   140
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   141
            	// Play a new audio
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   142
            	if (audioIndex !== wasPlaying) {
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   143
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   144
	            	var audioObj = $("#audio" + audioIndex);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   145
	            	var audio = audioObj.get(0);
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   146
					playingIndex = audioIndex;
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   147
94
873b0e9ff7f6 update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 92
diff changeset
   148
	            	if (audio.readyState === 4 || audio.readyState === 3) {
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   149
						// Play the sound
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   150
						playSound(audio);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   151
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   152
	            	} else {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   153
		            	// Load the sound
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   154
		            	audio.load();
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   155
						loading = true;	
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   156
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   157
						audioObj.bind("canplaythrough", function() {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   158
							// Play the sound
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   159
							playSound(audio);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   160
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   161
							// Unbind
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   162
							audioObj.unbind("canplaythrough");						
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   163
						});
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   164
					}
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   165
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   166
	            	// Add event timeupdate
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   167
					audioObj.bind("timeupdate", function() {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   168
						if (!loading) {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   169
		            		setTimeValue(audio.duration - audio.currentTime);
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   170
		            	}
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   171
					});
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   172
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   173
					// Add event ended
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   174
					audioObj.bind("ended", function() {
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   175
	            		// Change the button pause in play
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   176
    	        		$("#playpause" + playingIndex).css({"background-position" : '0 0'});
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   177
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   178
    	        		// Change the title color
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   179
						$("#title" + audioIndex).removeClass("gris");	
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   180
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   181
						// Unbind
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   182
						audioObj.unbind("timeupdate");
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   183
						audioObj.unbind("ended");
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   184
						playingIndex = -1;
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   185
					});
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   186
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   187
            		// Change the button pause in play
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   188
            		$("#playpause" + audioIndex).css({"background-position" : '0 -30px'});
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   189
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   190
					// Change the title color
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   191
					$("#title" + audioIndex).addClass("gris");	
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   192
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   193
					// Set the background
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   194
					$("#bgimage").attr("src", "static/res/img/choixMusique" + (audioIndex + 1)+ ".jpg");					
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   195
            	};
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   196
            };
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   197
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   198
            var playSound = function(audio) {
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   199
				audio.currentTime = 0;
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   200
				audio.play();
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   201
				loading = false;	            	
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   202
            };
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   203
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   204
            var setTimeValue = function(time) {
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   205
	            $("#current" + playingIndex).html(secondsToTime(time));
80
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents: 78
diff changeset
   206
            };
78
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   207
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   208
            this.secondsToTime = function(sec) {
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   209
				var minutes = Math.floor(sec / 60);
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   210
				var seconds = Math.floor(sec - minutes * 60);
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   211
				if (seconds < 10) {
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   212
					seconds = "0" + seconds;
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   213
				}
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   214
				return "" + minutes + "'" + seconds + "''";
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   215
			};
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   216
        </script>						
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   217
	
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   218
	</body>
8c3f0b94d056 big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff changeset
   219
</html>