web/musique-the-end-etc.html
author ymh <ymh.work@gmail.com>
Thu, 07 Feb 2013 13:52:53 +0100
changeset 120 72be7f52c743
parent 105 7a033d177687
child 124 8d2376eb825c
permissions -rw-r--r--
update config.py.tmpl and ldt

<!DOCTYPE html>
<html lang="fr">
	<head>
		<meta charset="UTF-8">
		<title>THE END, ETC. UNE EXPÉRIENCE WEB DE LAETITIA MASSON</title>
		
		<meta name="description" content="MEMO PROD présente THE END, ETC. Une coproduction FRANCE TÉLÉVISIONS - MEMO PROD avec la participation du CENTRE NATIONAL DU CINÉMA ET DE L’IMAGE ANIMÉE. Un projet écrit et réalisé par LAETITIA MASSON">

		<link rel="icon" href="static/res/img/favicon.ico" />		

		<!-- Mobile Specific Metas -->		
		<meta name="viewport" content="user-scalable=no">
		<!--
		<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width" />
		-->
		
		<!-- Test Smartphone  -->
	    <script src="static/res/js/incdetectmobile.js"></script>        
		<script>
			if (IsSmartphone()) { location.href = "mindex.html"; }	
		</script>
		<!-- Metanav FranceTV 	-->
		<script src="http://static.francetv.fr/js/jquery.metanav-min.js" charset="utf-8"></script>

		<link rel="stylesheet" href="static/res/css/style_1024.css" />

	</head>
	<body>
		<!-- div content - site takes the full height of browser -->			
		<div id="content" class="full_hightScreen">
			<div class="boxReturn">	
	       		<button class="btnReturn" onClick="location.href='the-end-etc.html';">Retour</button>  
			</div>
			
			<!--this div empty allows the element content_vcentering to be vertically aligned -->
			<section  id="intMusic" class="full_hightScreen">
				<div class="strut"></div><!--
				this comment corrects the white-space (display: inline);
				--><div id="bg_img" class="fullScreen_vcentering">
		    		<img id="bgimage" alt="The End, etc." src="static/res/img/choixMusique1.jpg" />
				</div>	
			</section>	
			<section id="playerAudio" class="positionAbs">
				<!--this div empty allows the element content_vcentering to be vertically aligned -->
				<div class="strut"></div><!--
				this comment corrects the white-space (display: inline);
				--><div class="fullScreen_vcentering white big_txt">
					<article class="boxAudio">
						<audio id="audio1" preload="metadata">
							<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.ogg" type="audio/ogg">
  							<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.mp3" type="audio/mpeg">
							<p>Audio non supportée </p>
						</audio>
						<button id="playpause1" onClick="play(1)" class="btnPlayPause txt_hidden">Play</button>
		                
		                <!-- class="txt_white" can be used to color current time in white -->
		                <p id="current1" class="time">0'00''</p>
		   				<p id="title1">LA MARSEILLAISE</p><br>
						
						
						<audio id="audio2" preload="metadata">
							<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.ogg" type="audio/ogg">
  							<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.mp3" type="audio/mpeg">
							<p>Audio non supportée </p>
						</audio>
						<button id="playpause2" onClick="play(2)" title="play" class="btnPlayPause txt_hidden">Play</button>
		                
		                <p id="current2" class="time">0'00''</p>
						<p id="title2">L'IDÉE</p><br>
						
						<audio id="audio3" preload="metadata">
							<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.ogg" type="audio/ogg">
  							<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.mp3" type="audio/mpeg">
							<p>Audio non supportée </p>
						</audio>
						<button id="playpause3" onClick="play(3)" title="play" class="btnPlayPause txt_hidden">Play</button>

		                <p id="current3" class="time">0'00''</p>
		   				<p id="title3">L'INTERNATIONALE</p><br>

						<audio id="audio4" preload="metadata">
							<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.ogg" type="audio/ogg">
  							<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.mp3" type="audio/mpeg">
							<p>Audio non supportée </p>
						</audio>
						<button id="playpause4" onClick="play(4)" title="play" class="btnPlayPause txt_hidden">Play</button>
		               	<p id="current4" class="time">0'00''</p>
		   				<p id="title4">NI DIEU NI MAÎTRE</p><br>

						<audio id="audio5" preload="metadata">
	   						<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.ogg" type="audio/ogg">
  							<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.mp3" type="audio/mpeg">
							<p>Audio non supportée </p>
						</audio>
						<button id="playpause5" onClick="play(5)" title="play" class="btnPlayPause txt_hidden">Play</button>

		               	<p id="current5" class="time">0'00''</p>
		   				<p id="title5">L'ENVERS DU ZÉBU</p>
		   			</article>
				</div>
			</section>

		</div>

		<!-- JavaScript -->
        <script src="static/res/js/jquery-1.8.2.min.js"></script>        		
        <script>
            var playingIndex = -1;
            var loading = false;

            var play = function(audioIndex) {

            	if (loading) {
            		return;
            	}

            	var wasPlaying = playingIndex;

            	// Stop the current played audio ?
            	if (playingIndex !== -1 ) {
	            	var audioObj = $("#audio" + playingIndex);
	            	var audio = audioObj.get(0);

					// Unbind all events
					audioObj.unbind("canplaythrough");
					audioObj.unbind("timeupdate");
					audioObj.unbind("ended");

            		// Pause the audio
	            	audio.pause();
	            	setTimeValue(0);

            		// Change the button pause in play
            		$("#playpause" + playingIndex).css({"background-position" : '0 0'});

            		// Change the title color
					$("#title" + playingIndex).removeClass("gris");	

            		playingIndex = -1;
            	}

            	// Play a new audio
            	if (audioIndex !== wasPlaying) {

	            	var audioObj = $("#audio" + audioIndex);
	            	var audio = audioObj.get(0);
					playingIndex = audioIndex;

	            	if (audio.readyState === 4 || audio.readyState === 3) {
						// Play the sound
						playSound(audio);

	            	} else {
		            	// Load the sound
		            	audio.load();
						loading = true;	

						audioObj.bind("canplaythrough", function() {
							// Play the sound
							playSound(audio);

							// Unbind
							audioObj.unbind("canplaythrough");						
						});
					}

	            	// Add event timeupdate
					audioObj.bind("timeupdate", function() {
						if (!loading) {
		            		setTimeValue(audio.duration - audio.currentTime);
		            	}
					});

					// Add event ended
					audioObj.bind("ended", function() {
	            		// Change the button pause in play
    	        		$("#playpause" + playingIndex).css({"background-position" : '0 0'});

    	        		// Change the title color
						$("#title" + audioIndex).removeClass("gris");	

						// Unbind
						audioObj.unbind("timeupdate");
						audioObj.unbind("ended");
						playingIndex = -1;
					});

            		// Change the button pause in play
            		$("#playpause" + audioIndex).css({"background-position" : '0 -30px'});

					// Change the title color
					$("#title" + audioIndex).addClass("gris");	

					// Set the background
					$("#bgimage").attr("src", "static/res/img/choixMusique" + (audioIndex + 1)+ ".jpg");					
            	};
            };

            var playSound = function(audio) {
				audio.currentTime = 0;
				audio.play();
				loading = false;	            	
            };

            var setTimeValue = function(time) {
	            $("#current" + playingIndex).html(secondsToTime(time));
            };

            this.secondsToTime = function(sec) {
				var minutes = Math.floor(sec / 60);
				var seconds = Math.floor(sec - minutes * 60);
				if (seconds < 10) {
					seconds = "0" + seconds;
				}
				return "" + minutes + "'" + seconds + "''";
			};
        </script>						
	
	</body>
</html>