| author | ymh <ymh.work@gmail.com> |
| Tue, 22 Jan 2013 13:18:26 +0100 | |
| changeset 97 | 3f75cc00d6da |
| parent 94 | 873b0e9ff7f6 |
| 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> |
|
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 | 48 |
<audio id="audio1" preload="metadata"> |
| 88 | 49 |
<source src="http://clients.incandescence.com/theend/musique/MARSEILLAISE-CHANT_3.ogg" type="audio/ogg"> |
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 | 60 |
<audio id="audio2" preload="metadata"> |
| 88 | 61 |
<source src="http://clients.incandescence.com/theend/musique/IDEE-CHANT_5.ogg" type="audio/ogg"> |
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 | 70 |
<audio id="audio3" preload="metadata"> |
| 88 | 71 |
<source src="http://clients.incandescence.com/theend/musique/INTERNATIONALE-CHANT_1.ogg" type="audio/ogg"> |
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 | 80 |
<audio id="audio4" preload="metadata"> |
| 88 | 81 |
<source src="http://clients.incandescence.com/theend/musique/NIDIEU-CHANT-2.ogg" type="audio/ogg"> |
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 | 89 |
<audio id="audio5" preload="metadata"> |
| 88 | 90 |
<source src="http://clients.incandescence.com/theend/musique/ZEBU-CHANT_4.ogg" type="audio/ogg"> |
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 | 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 | 112 |
if (loading) { |
113 |
return; |
|
114 |
} |
|
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 | 120 |
var audioObj = $("#audio" + playingIndex); |
121 |
var audio = audioObj.get(0); |
|
122 |
||
123 |
// Unbind all events |
|
124 |
audioObj.unbind("canplaythrough"); |
|
125 |
audioObj.unbind("timeupdate"); |
|
126 |
audioObj.unbind("ended"); |
|
127 |
||
|
78
8c3f0b94d056
big commit after problems
Edwin Razafimahatratra <edwin@robotalismsoft.com>
parents:
diff
changeset
|
128 |
// Pause the audio |
| 80 | 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 | 143 |
|
144 |
var audioObj = $("#audio" + audioIndex); |
|
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 | 149 |
// Play the sound |
150 |
playSound(audio); |
|
151 |
||
152 |
} else { |
|
153 |
// Load the sound |
|
154 |
audio.load(); |
|
155 |
loading = true; |
|
156 |
||
157 |
audioObj.bind("canplaythrough", function() { |
|
158 |
// Play the sound |
|
159 |
playSound(audio); |
|
160 |
||
161 |
// Unbind |
|
162 |
audioObj.unbind("canplaythrough"); |
|
163 |
}); |
|
164 |
} |
|
165 |
||
166 |
// Add event timeupdate |
|
167 |
audioObj.bind("timeupdate", function() { |
|
168 |
if (!loading) { |
|
169 |
setTimeValue(audio.duration - audio.currentTime); |
|
170 |
} |
|
171 |
}); |
|
172 |
||
173 |
// Add event ended |
|
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 | 177 |
|
178 |
// Change the title color |
|
179 |
$("#title" + audioIndex).removeClass("gris"); |
|
180 |
||
181 |
// Unbind |
|
182 |
audioObj.unbind("timeupdate"); |
|
183 |
audioObj.unbind("ended"); |
|
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 | 192 |
|
193 |
// Set the background |
|
194 |
$("#bgimage").attr("src", "static/res/img/choixMusique" + (audioIndex + 1)+ ".jpg"); |
|
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 | 198 |
var playSound = function(audio) { |
199 |
audio.currentTime = 0; |
|
200 |
audio.play(); |
|
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 | 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> |