-
Notifications
You must be signed in to change notification settings - Fork 0
/
slider.html
executable file
·213 lines (181 loc) · 4.63 KB
/
slider.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/player_style.css">
<script src="js/jquery.js"></script>
<script src="js/jquery.ui.min.js"></script>
<script>
$(function() {
initAudio();
});
function initAudio() {
var supportsAudio = !!document.createElement('audio').canPlayType,
audio,
loadingIndicator,
positionIndicator,
timeleft,
loaded = false,
manualSeek = false;
if (supportsAudio) {
var player_code = '<p class="player">\
<span id="playtoggle" />\
<span id="gutter">\
<span id="loading" style="display: none;" />\
<span id="handle" class="ui-slider-handle" />\
</span>\
<span id="timeleft" />\
<audio preload="metadata" id="popcorn">\
<source src="media/narration.mp3" type="audio/mpeg"></source>\
<source src="media/narration.ogg" type="audio/vorbis"></source>\
</audio>\
</p>';
$(player_code).insertAfter("#header");
audio = $('.player audio').get(0);
loadingIndicator = $('.player #loading');
positionIndicator = $('.player #handle');
timeleft = $('.player #timeleft');
$(audio).bind('timeupdate', function() {
var rem = parseInt(audio.duration - audio.currentTime, 10),
pos = (audio.currentTime / audio.duration) * 100,
mins = Math.floor(rem/60,10),
secs = rem - mins*60;
timeleft.text('-' + mins + ':' + (secs < 10 ? '0' + secs : secs));
if (!manualSeek) { positionIndicator.css({top: pos + '%'}); }
if (!loaded) {
loaded = true;
$('.player #gutter').slider({
value: 0,
step: 0.01,
orientation: "vertical",
range: "min",
max: audio.duration,
animate: true,
slide: function(){
manualSeek = true;
},
stop:function(e,ui){
manualSeek = false;
audio.currentTime = ui.value;
}
});
}
}).bind('play',function(){
$("#playtoggle").addClass('playing');
}).bind('pause ended', function() {
$("#playtoggle").removeClass('playing');
});
$("#playtoggle").click(function() {
if (audio.paused) { audio.play(); }
else { audio.pause(); }
});
}
}
</script>
<script src="js/libs/modernizr-2.5.3.min.js"></script>
<script src="http://cdn.popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function () {
var pop = Popcorn("#popcorn");
pop.image({
id:'',
start:'13',
end:'14.5',
src:'photos/Pakistan/Berlin Flight Changes.jpg',
target:'webpage'});
pop.image({
id:'',
start:'14.5',
end:'16.5',
src:'photos/Early Years Headley/ss9.jpg',
target:'webpage'});
pop.image({
id:'',
start:'16.5',
end:'19.5',
src:'photos/Drugs 2.jpg',
target:'webpage'});
// LOOK AT THIS
pop.image({
id:'',
start:'19.5',
end:'23',
src:'photos/cuffs.jpeg',
target:'webpage'});
pop.image({
id:'',
start:'23',
end:'27',
src:'photos/DEA/interrogation.jpg',
target:'webpage'});
pop.image({
id:'',
start:'33',
end:'43',
src:'photos/Early Years Headley/ss6.jpg',
target:'webpage'});
pop.image({
id:'',
start:'53',
end:'56',
src:'photos/mentor.jpg',
target:'webpage'});
/*
pop.image({
id:'',
start:'',
end:'24',
src:'photos/ss8.jpeg',
target:'webpage'});
pop.image({
id:'',
start:'25',
end:'27',
src:'photos/ss9.jpeg',
target:'webpage'});
pop.image({
id:'',
start:'28',
end:'30',
src:'photos/ss10.jpeg',
target:'webpage'});
pop.image({
id:'',
start:'31',
end:'33',
src:'photos/ss11.jpeg',
target:'webpage'});
*/
}, false);
</script>
</head>
<body>
<!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
<header id="header">
</header>
<div id="webpage">
</div>
<!--
<div role="main">
<p class="player">
<span id="playtoggle" />
<span id="gutter">
<span id="loading" />
<span id="handle" class="ui-slider-handle" />
</span>
<span id="timeleft" />
</p>
</div>
-->
<footer>
</footer>
</body>
</html>