-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
45 lines (34 loc) · 1.33 KB
/
script.js
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
document.addEventListener( "DOMContentLoaded", function(){
// Test
function log( data ) {
console.log( data );
}
archiveUtil.search( "2012elections", function( data ) {
var videoContainer = document.getElementById( "video" ),
videoEl,
srcEl;
$.each( data, function( index, item ) {
videoEl = document.createElement( "video" );
srcEl = document.createElement( "source" );
srcEl.src = archiveUtil.downloadFile( item.identifier, "ogv" );
videoEl.appendChild( srcEl );
videoContainer.appendChild( videoEl );
// Create an element below the video with all the meta data (title, the transcript, date, tv show, and a link to the archive page) below
// show on hover
});
});
archiveUtil.search({
q: "camels"
}, log );
archiveUtil.details( "camels", log );
archiveUtil.searchTV( "obamacare", function( data ) {
console.log( "obama", data );
$.each( data, function( index, item ){
var id = item.identifier;
archiveUtil.details( id, function( _data ){
var srt = archiveUtil.getFiles( _data.files, "srt" )[0];
console.log( srt );
});
});
});
}, false);