-
Notifications
You must be signed in to change notification settings - Fork 0
/
original_boot_theater.html
149 lines (106 loc) · 3.62 KB
/
original_boot_theater.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
<!DOCTYPE html>
<!-- APPLE BOOT THEATER, by Charles Mangin -->
<!-- Requires Javascript. Utilizes the 4am boot video collection -->
<!-- to provide an endless grid of booting Apple II programs -->
<!-- for whatever reason you might need that. -->
<html>
<head>
<title>Apple Boot Theater, by Charles Mangin</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script type='text/javascript'>
//<![CDATA[
function padDigits(number, digits) {
return Array(Math.max(digits - String(number).length + 1, 0)).join(0) + number;
}
window.onload=function(){
var videos = [];
var gridVideos = document.getElementsByTagName("video");
$.getJSON( "https://archive.org/advancedsearch.php?q=collection%3A%284amp4%29+AND+mediatype%3A%28movies%29&fl%5B%5D=identifier&sort%5B%5D=addeddate+desc&sort%5B%5D=&sort%5B%5D=&rows=500&page=1&output=json&callback=?&save=yes", function( data ) {
console.log('loaded');
var identifiers = []; // create array here
$.each(data.response.docs, function (index, doc) {
identifiers.push(doc.identifier); //push values here
var identifierURL = "https://archive.org/metadata/" + doc.identifier + "&callback=?";
//console.log(identifierURL);
$.getJSON( identifierURL, function( item ) {
// var items = [];
// console.log(item.dir);
$.each( item.files, function( key, val ) {
if(val.format == "Ogg Video") {
var MP4URL= "https://archive.org" + item.dir +"/"+ val.name;
// console.log(MP4URL);
videos.push( MP4URL );
$('#progress').css("width",identifiers.length);
$('#bar').css("width",videos.length);
if(videos.length == identifiers.length - 1) {
$('#progress').hide();
for(var i=0;i<gridVideos.length;i++){
playArray(i,gridVideos[i],videos,null);
}
}
}
});
});
});
});
/* for(i=0;i<516;i++){
videos[i] = padDigits(i,4) + ".mp4";
}
*/
function playArray(index,ele,array,listener){
index=Math.floor(Math.random()*array.length);
ele.src = array[index];
ele.load();
//ele.play();
index++;
if(index>=array.length){
index=0;
}
listener = ele.addEventListener('ended',function(){
playArray(index,ele,array,listener);
},false);
console.log("Playing " + videos[index]);
}
}
//]]>
</script>
<style>
video {
width: 25%;
height: 30%;
padding: 0;
margin: 0;
float:left;
}
body {
padding: 0;
margin: 0;
background: #000;
}
</style>
</head>
<body>
<div id="container" style="width:100%">
<div id="progress" style="border:1px solid #fff;height:10px; padding: 1px; margin: 10% auto; width: 0px;">
<div id="bar" style="height:8px; float: left; background-color: #fff;"></div>
</div>
<div id="grid" style="margin:auto; width:90%;">
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
<video id="GridVideo" autoplay="true"></video>
</div>
</div>
</body>
</html>