-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·59 lines (49 loc) · 1.88 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
<!doctype html>
<html>
<head>
<!-- Add in JavaScript File When Created -->
<!-- Add in main.js -->
<link rel="stylesheet" href="css/index.css">
</head>
<body>
<!--
<h1 id="status_of_video"> No Status... </h1>
-->
<h1 id="videoTitle"> Futurama: S02E01 </h1>
<div id="test00">
<video id="Futurama_Video" controls>
<source src="videos/S02E01.mp4" type="video/mp4">
</video>
</div>
<!-- Add Pause/Play Buttons -->
<button type="button" id="pauseButton">PAUSE</button>
<button type="button" id="playButton">PLAY</button>
<!-- Time to Script :-) -->
<script src="js/main.js"></script>
<script>
var futurama_Video = document.getElementById("Futurama_Video");
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var status = this.responseText;
if (status.indexOf("false") !== -1) {
// document.getElementById("status_of_video").innerHTML = "File Says Playing...";
futurama_Video.play();
} else {
// document.getElementById("status_of_video").innerHTML = "File Says Paused...";
futurama_Video.pause();
}
}
};
xhttp.open("POST", "ajax_info.txt", true);
xhttp.send();
}
var x = setInterval(function() {
// check flag for setInterval && AJAX
// document.getElementById("status_of_video").innerHTML = "FUNCTION CALLED";
loadDoc();
}, 1000);
</script>
</body>
</html>