| author | Edwin Razafimahatratra <edwin@robotalismsoft.com> |
| Thu, 24 Jan 2013 16:30:41 +0100 | |
| changeset 103 | be6c1f9cc258 |
| parent 102 | 097e4023ede3 |
| child 105 | 7a033d177687 |
| 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 |
|
| 103 | 7 |
<meta name="description" content="Géraldine Michelon présente The End, etc. Un projet écrit et réalisé par Laetitia Masson. Une coproduction France Télévisions - Memo Prod avec la participation du Centre national du cinéma et de l'image animée, Incandescence et Institut de recherche et de l'innovation du Centre Georges Pompidou, en association avec France Inter."> |
8 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
9 |
<link rel="icon" href="static/res/img/favicon.ico" /> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
10 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
11 |
<!-- Mobile Specific Metas --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
12 |
<meta name="viewport" content="user-scalable=no"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
13 |
<!-- |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
14 |
<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
|
15 |
--> |
|
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 |
<!-- Test Smartphone --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
18 |
<script src="static/res/js/incdetectmobile.js"></script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
19 |
<script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
20 |
if (IsSmartphone()) { location.href = "mindex.html"; } |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
21 |
</script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
22 |
<!-- Metanav FranceTV --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
23 |
<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
|
24 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
25 |
<link rel="stylesheet" href="static/res/css/style_1024.css" /> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
26 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
27 |
</head> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
28 |
<body> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
29 |
<!-- div content - site takes the full height of browser --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
30 |
<div id="content" class="full_hightScreen"> |
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
31 |
<div class="boxReturn"> |
|
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
32 |
<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
|
33 |
</div> |
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
34 |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
35 |
<!--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
|
36 |
<section id="intMusic" class="full_hightScreen"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
37 |
<div class="strut"></div><!-- |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
38 |
this comment corrects the white-space (display: inline); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
39 |
--><div id="bg_img" class="fullScreen_vcentering"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
40 |
<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
|
41 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
42 |
</section> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
43 |
<section id="playerAudio" class="positionAbs"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
44 |
<!--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
|
45 |
<div class="strut"></div><!-- |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
46 |
this comment corrects the white-space (display: inline); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
47 |
--><div class="fullScreen_vcentering white big_txt"> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
48 |
<article class="boxAudio"> |
| 80 | 49 |
<audio id="audio1" preload="metadata"> |
| 88 | 50 |
<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.ogg" type="audio/ogg"> |
51 |
<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
|
52 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
53 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
54 |
<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
|
55 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
56 |
<!-- 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
|
57 |
<p id="current1" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
58 |
<p id="title1">LA MARSEILLAISE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
59 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
60 |
|
| 80 | 61 |
<audio id="audio2" preload="metadata"> |
| 88 | 62 |
<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.ogg" type="audio/ogg"> |
63 |
<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
|
64 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
65 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
66 |
<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
|
67 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
68 |
<p id="current2" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
69 |
<p id="title2">L'IDÉE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
70 |
|
| 80 | 71 |
<audio id="audio3" preload="metadata"> |
| 88 | 72 |
<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.ogg" type="audio/ogg"> |
73 |
<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
|
74 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
75 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
76 |
<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
|
77 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
78 |
<p id="current3" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
79 |
<p id="title3">L'INTERNATIONALE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
80 |
|
| 80 | 81 |
<audio id="audio4" preload="metadata"> |
| 88 | 82 |
<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.ogg" type="audio/ogg"> |
83 |
<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
|
84 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
85 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
86 |
<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
|
87 |
<p id="current4" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
88 |
<p id="title4">NI DIEU NI MAÎTRE</p><br> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
89 |
|
| 80 | 90 |
<audio id="audio5" preload="metadata"> |
| 88 | 91 |
<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.ogg" type="audio/ogg"> |
92 |
<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
|
93 |
<p>Audio non supportée </p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
94 |
</audio> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
95 |
<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
|
96 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
97 |
<p id="current5" class="time">0'00''</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
98 |
<p id="title5">L'ENVERS DU ZÉBU</p> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
99 |
</article> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
100 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
101 |
</section> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
102 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
103 |
</div> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
104 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
105 |
<!-- JavaScript --> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
106 |
<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
|
107 |
<script> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
108 |
var playingIndex = -1; |
| 80 | 109 |
var loading = false; |
|
78
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 |
var play = function(audioIndex) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
112 |
|
| 80 | 113 |
if (loading) { |
114 |
return; |
|
115 |
} |
|
116 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
117 |
var wasPlaying = playingIndex; |
|
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 |
// Stop the current played audio ? |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
120 |
if (playingIndex !== -1 ) { |
| 80 | 121 |
var audioObj = $("#audio" + playingIndex); |
122 |
var audio = audioObj.get(0); |
|
123 |
||
124 |
// Unbind all events |
|
125 |
audioObj.unbind("canplaythrough"); |
|
126 |
audioObj.unbind("timeupdate"); |
|
127 |
audioObj.unbind("ended"); |
|
128 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
129 |
// Pause the audio |
| 80 | 130 |
audio.pause(); |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
131 |
setTimeValue(0); |
|
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 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
134 |
$("#playpause" + playingIndex).css({"background-position" : '0 0'}); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
135 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
136 |
// Change the title color |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
137 |
$("#title" + playingIndex).removeClass("gris"); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
138 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
139 |
playingIndex = -1; |
|
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 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
142 |
// Play a new audio |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
143 |
if (audioIndex !== wasPlaying) { |
| 80 | 144 |
|
145 |
var audioObj = $("#audio" + audioIndex); |
|
146 |
var audio = audioObj.get(0); |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
147 |
playingIndex = audioIndex; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
148 |
|
|
94
873b0e9ff7f6
update html
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
92
diff
changeset
|
149 |
if (audio.readyState === 4 || audio.readyState === 3) { |
| 80 | 150 |
// Play the sound |
151 |
playSound(audio); |
|
152 |
||
153 |
} else { |
|
154 |
// Load the sound |
|
155 |
audio.load(); |
|
156 |
loading = true; |
|
157 |
||
158 |
audioObj.bind("canplaythrough", function() { |
|
159 |
// Play the sound |
|
160 |
playSound(audio); |
|
161 |
||
162 |
// Unbind |
|
163 |
audioObj.unbind("canplaythrough"); |
|
164 |
}); |
|
165 |
} |
|
166 |
||
167 |
// Add event timeupdate |
|
168 |
audioObj.bind("timeupdate", function() { |
|
169 |
if (!loading) { |
|
170 |
setTimeValue(audio.duration - audio.currentTime); |
|
171 |
} |
|
172 |
}); |
|
173 |
||
174 |
// Add event ended |
|
175 |
audioObj.bind("ended", function() { |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
176 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
177 |
$("#playpause" + playingIndex).css({"background-position" : '0 0'}); |
| 80 | 178 |
|
179 |
// Change the title color |
|
180 |
$("#title" + audioIndex).removeClass("gris"); |
|
181 |
||
182 |
// Unbind |
|
183 |
audioObj.unbind("timeupdate"); |
|
184 |
audioObj.unbind("ended"); |
|
185 |
playingIndex = -1; |
|
|
78
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 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
188 |
// Change the button pause in play |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
189 |
$("#playpause" + audioIndex).css({"background-position" : '0 -30px'}); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
190 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
191 |
// Change the title color |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
192 |
$("#title" + audioIndex).addClass("gris"); |
| 80 | 193 |
|
194 |
// Set the background |
|
195 |
$("#bgimage").attr("src", "static/res/img/choixMusique" + (audioIndex + 1)+ ".jpg"); |
|
196 |
}; |
|
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
197 |
}; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
198 |
|
| 80 | 199 |
var playSound = function(audio) { |
200 |
audio.currentTime = 0; |
|
201 |
audio.play(); |
|
202 |
loading = false; |
|
|
78
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 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
205 |
var setTimeValue = function(time) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
206 |
$("#current" + playingIndex).html(secondsToTime(time)); |
| 80 | 207 |
}; |
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
208 |
|
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
209 |
this.secondsToTime = function(sec) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
210 |
var minutes = Math.floor(sec / 60); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
211 |
var seconds = Math.floor(sec - minutes * 60); |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
212 |
if (seconds < 10) { |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
213 |
seconds = "0" + seconds; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
214 |
} |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
215 |
return "" + minutes + "'" + seconds + "''"; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
216 |
}; |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
217 |
</script> |
|
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 |
</body> |
|
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
220 |
</html> |