-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
72 lines (65 loc) · 2.1 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
<!DOCTYPE html>
<html>
<head>
<title>Radio Disorient</title>
<style>
body { font: sans-serif; }
#d {
position: absolute;
top: 50%;
left: 50%;
width: 25%;
margin-left: -12.5%;
margin-top: -12.5%;
cursor: pointer;
}
#playstop {
position: absolute;
left: 50%;
top: 50%;
text-align: center;
width: 5%;
margin-top: -5%;
margin-left: -2.5%;
z-index: -1;
}
</style>
</head>
<body>
<img id="d" src="d.png" />
<audio id="player"></audio>
<img id="playstop" src="play.png" />
<script>
var list = [
"INTRO AUDIO 90.3 FEMALE.wav",
"THE ALL NIGHTER.wav",
"SATELLITE SEANCES BREAK.mp3",
"Sound_PSA.mp3",
"90.3 tag male radio synth.wav",
"TICKS PSA.mp3"
]
var index = 0
var button = document.getElementById('d');
var player = document.getElementById('player');
var playstop = document.getElementById('playstop');
function play() {
if (player.currentTime > 0 && !player.paused) {
player.pause();
playstop.src = "play.png";
}
else {
playstop.src = "stop.png";
console.log("Playing " + index + ": " + list[index]);
player.src = list[index];
player.play();
index += 1;
if (index >= list.length) {
index=0;
}
}
}
button.addEventListener("click", play);
player.addEventListener("ended", play);
</script>
</body>
</html>