-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·130 lines (107 loc) · 4.05 KB
/
index.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
<!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">
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<script src="js/libs/modernizr-2.5.3.min.js"></script>
<script type="text/javascript" src="js/d3.v2.js?2.8.1"></script>
<script type="text/javascript" src="js/underscore-min.js"></script>
<script src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script src="js/jquery.ui.min.js"></script>
<script src="http://vjs.zencdn.net/c/video.js"></script>
<script src="js/videoplayer.js"></script>
<script src="js/node-data.js"></script>
<script src="js/widget.js"></script>
<script src="http://cdn.popcornjs.org/code/dist/popcorn-complete.min.js"></script>
<script type="text/javascript" src="js/popcorn-images.js"></script>
</head>
<body onload="setup_timeline()">
<input type="range" min="0" max="168" value="0" style="width:900px" onchange="update(this.value)"></input>
<!--[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">
<h1>A Perfect Terrorist</h1>
<h2>The Web of David Coleman Headley</h2>
</header>
<div id="content" role="main">
<div id="background"></div>
<div id="chart"></div>
<div id="foreground"></div>
</div>
<footer>
</footer>
<script type="text/javascript" src="js/timeline-graph.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="playhead" />\
<audio id="popcorn" preload="metadata">\
<source src="media/narration.mp3" type="audio/mpeg"></source>\
<source src="media/narration.ogg" type="audio/vorbis"></source>\
</audio>\
</p>';
$(player_code).appendTo("#foreground");
audio = $('.player audio').get(0);
loadingIndicator = $('.player #loading');
positionIndicator = $('.player #playhead');
timeleft = $('.player #timeleft');
$(audio).bind('timeupdate', function() {
update(audio.currentTime);
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>
</body>
</html>