| author | ymh <ymh.work@gmail.com> |
| Fri, 08 Feb 2013 17:53:10 +0100 | |
| changeset 127 | 49f930abb58a |
| parent 124 | 8d2376eb825c |
| permissions | -rw-r--r-- |
|
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> |
| 103 | 4 |
<meta charset="UTF-8"> |
5 |
<title>THE END, ETC. UNE EXPÉRIENCE WEB DE LAETITIA MASSON</title> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
6 |
|
| 124 | 7 |
<meta name="robots" content="noindex"> |
| 105 | 8 |
<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"> |
| 103 | 9 |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
10 |
<link rel="icon" href="static/res/img/favicon.ico" /> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
11 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
12 |
<!-- Mobile Specific Metas --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
13 |
<meta name="viewport" content="user-scalable=no"> |
|
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 |
<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
|
16 |
--> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
17 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
18 |
<!-- Test Smartphone --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
19 |
<script src="static/res/js/incdetectmobile.js"></script> |
|
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 |
if (IsSmartphone()) { location.href = "mindex.html"; } |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
22 |
</script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
23 |
<!-- Metanav FranceTV --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
24 |
<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
|
25 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
26 |
<link rel="stylesheet" href="static/res/css/style_1024.css" /> |
| 124 | 27 |
|
28 |
<!-- tags FTV Variables Xiti--> |
|
29 |
<script> |
|
30 |
<!--//--><![CDATA[//><!-- |
|
31 |
// Variables Xiti |
|
32 |
var xtsite = "511613"; |
|
33 |
var xtn2 = "5"; |
|
34 |
var xtpage = "Espace_transitoire::The_End_Etc::musique"; |
|
35 |
//--><!]]> |
|
36 |
</script> |
|
37 |
<noscript> |
|
38 |
<img width="1" height="1" alt="" src="http://logc238.xiti.com/hit.xiti?s=511613&s2=5&p=Espace_transitoire::The_End_Etc::musique" > |
|
39 |
</noscript> |
|
40 |
<script src="http://static.francetv.fr/js/audience-min.js"></script> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
41 |
</head> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
42 |
<body> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
43 |
<!-- div content - site takes the full height of browser --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
44 |
<div id="content" class="full_hightScreen"> |
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
45 |
<div class="boxReturn"> |
|
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
46 |
<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
|
47 |
</div> |
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
48 |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
49 |
<!--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
|
50 |
<section id="intMusic" class="full_hightScreen"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
51 |
<div class="strut"></div><!-- |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
52 |
this comment corrects the white-space (display: inline); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
53 |
--><div id="bg_img" class="fullScreen_vcentering"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
54 |
<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
|
55 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
56 |
</section> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
57 |
<section id="playerAudio" class="positionAbs"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
58 |
<!--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
|
59 |
<div class="strut"></div><!-- |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
60 |
this comment corrects the white-space (display: inline); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
61 |
--><div class="fullScreen_vcentering white big_txt"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
62 |
<article class="boxAudio"> |
| 80 | 63 |
<audio id="audio1" preload="metadata"> |
| 124 | 64 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/MARSEILLAISE-CHANT_3.ogg" type="audio/ogg"> |
65 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/MARSEILLAISE-CHANT_3.mp3" type="audio/mpeg"> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
66 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
67 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
68 |
<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
|
69 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
70 |
<!-- 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
|
71 |
<p id="current1" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
72 |
<p id="title1">LA MARSEILLAISE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
73 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
74 |
|
| 80 | 75 |
<audio id="audio2" preload="metadata"> |
| 124 | 76 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/IDEE-CHANT_5.ogg" type="audio/ogg"> |
77 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/IDEE-CHANT_5.mp3" type="audio/mpeg"> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
78 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
79 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
80 |
<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
|
81 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
82 |
<p id="current2" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
83 |
<p id="title2">L'IDÉE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
84 |
|
| 80 | 85 |
<audio id="audio3" preload="metadata"> |
| 124 | 86 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/INTERNATIONALE-CHANT_1.ogg" type="audio/ogg"> |
87 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/INTERNATIONALE-CHANT_1.mp3" type="audio/mpeg"> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
88 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
89 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
90 |
<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
|
91 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
92 |
<p id="current3" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
93 |
<p id="title3">L'INTERNATIONALE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
94 |
|
| 80 | 95 |
<audio id="audio4" preload="metadata"> |
| 124 | 96 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/NIDIEU-CHANT-2.ogg" type="audio/ogg"> |
97 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/NIDIEU-CHANT-2.mp3" type="audio/mpeg"> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
98 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
99 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
100 |
<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
|
101 |
<p id="current4" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
102 |
<p id="title4">NI DIEU NI MAÎTRE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
103 |
|
| 80 | 104 |
<audio id="audio5" preload="metadata"> |
| 124 | 105 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/ZEBU-CHANT_4.ogg" type="audio/ogg"> |
106 |
<source src="http://dvvsyrlsr21oz.cloudfront.net/musique/ZEBU-CHANT_4.mp3" type="audio/mpeg"> |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
107 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
108 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
109 |
<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
|
110 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
111 |
<p id="current5" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
112 |
<p id="title5">L'ENVERS DU ZÉBU</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
113 |
</article> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
114 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
115 |
</section> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
116 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
117 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
118 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
119 |
<!-- JavaScript --> |
| 124 | 120 |
<script src="static/res/js/jquery-1.8.2.min.js"></script> |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
121 |
<script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
122 |
var playingIndex = -1; |
| 80 | 123 |
var loading = false; |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
124 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
125 |
var play = function(audioIndex) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
126 |
|
| 80 | 127 |
if (loading) { |
128 |
return; |
|
129 |
} |
|
130 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
131 |
var wasPlaying = playingIndex; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
132 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
133 |
// Stop the current played audio ? |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
134 |
if (playingIndex !== -1 ) { |
| 80 | 135 |
var audioObj = $("#audio" + playingIndex); |
136 |
var audio = audioObj.get(0); |
|
137 |
||
138 |
// Unbind all events |
|
139 |
audioObj.unbind("canplaythrough"); |
|
140 |
audioObj.unbind("timeupdate"); |
|
141 |
audioObj.unbind("ended"); |
|
142 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
143 |
// Pause the audio |
| 80 | 144 |
audio.pause(); |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
145 |
setTimeValue(0); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
146 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
147 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
148 |
$("#playpause" + playingIndex).css({"background-position" : '0 0'}); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
149 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
150 |
// Change the title color |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
151 |
$("#title" + playingIndex).removeClass("gris"); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
152 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
153 |
playingIndex = -1; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
154 |
} |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
155 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
156 |
// Play a new audio |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
157 |
if (audioIndex !== wasPlaying) { |
| 80 | 158 |
|
159 |
var audioObj = $("#audio" + audioIndex); |
|
160 |
var audio = audioObj.get(0); |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
161 |
playingIndex = audioIndex; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
162 |
|
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
163 |
if (audio.readyState === 4 || audio.readyState === 3) { |
| 80 | 164 |
// Play the sound |
165 |
playSound(audio); |
|
166 |
||
167 |
} else { |
|
168 |
// Load the sound |
|
169 |
audio.load(); |
|
170 |
loading = true; |
|
171 |
||
172 |
audioObj.bind("canplaythrough", function() { |
|
173 |
// Play the sound |
|
174 |
playSound(audio); |
|
175 |
||
176 |
// Unbind |
|
177 |
audioObj.unbind("canplaythrough"); |
|
178 |
}); |
|
179 |
} |
|
180 |
||
181 |
// Add event timeupdate |
|
182 |
audioObj.bind("timeupdate", function() { |
|
183 |
if (!loading) { |
|
184 |
setTimeValue(audio.duration - audio.currentTime); |
|
185 |
} |
|
186 |
}); |
|
187 |
||
188 |
// Add event ended |
|
189 |
audioObj.bind("ended", function() { |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
190 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
191 |
$("#playpause" + playingIndex).css({"background-position" : '0 0'}); |
| 80 | 192 |
|
193 |
// Change the title color |
|
194 |
$("#title" + audioIndex).removeClass("gris"); |
|
195 |
||
196 |
// Unbind |
|
197 |
audioObj.unbind("timeupdate"); |
|
198 |
audioObj.unbind("ended"); |
|
199 |
playingIndex = -1; |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
200 |
}); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
201 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
202 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
203 |
$("#playpause" + audioIndex).css({"background-position" : '0 -30px'}); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
204 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
205 |
// Change the title color |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
206 |
$("#title" + audioIndex).addClass("gris"); |
| 80 | 207 |
|
208 |
// Set the background |
|
209 |
$("#bgimage").attr("src", "static/res/img/choixMusique" + (audioIndex + 1)+ ".jpg"); |
|
210 |
}; |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
211 |
}; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
212 |
|
| 80 | 213 |
var playSound = function(audio) { |
214 |
audio.currentTime = 0; |
|
215 |
audio.play(); |
|
216 |
loading = false; |
|
|
78
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 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
219 |
var setTimeValue = function(time) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
220 |
$("#current" + playingIndex).html(secondsToTime(time)); |
| 80 | 221 |
}; |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
222 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
223 |
this.secondsToTime = function(sec) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
224 |
var minutes = Math.floor(sec / 60); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
225 |
var seconds = Math.floor(sec - minutes * 60); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
226 |
if (seconds < 10) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
227 |
seconds = "0" + seconds; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
228 |
} |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
229 |
return "" + minutes + "'" + seconds + "''"; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
230 |
}; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
231 |
</script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
232 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
233 |
</body> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
234 |
</html> |