-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
secret.html
82 lines (72 loc) · 2.54 KB
/
secret.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
<!DOCTYPE html>
<html>
<head>
<title>Wizard Remote Control - Control Page</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="holder">
<div class="bottomItems">
<img src="ico64.jpg"/>
Wizard Remote Control 1.0.0 WebClient
</div>
<div class="bottomItems">
<div>Text:</div>
<textarea></textarea>
<button id="sendTextBtn">Send text</button>
</div>
<div class="bottomItems" id="bottom-bar">
<div id="output"></div>
</div>
<div class="bottomItems">
<i>In case of inactivity you can try to refresh page.</i>
</div>
</div>
<canvas id="video-canvas" style="height:100vh;" ></canvas>
<script type="text/javascript" src="jsmpeg.min.js"></script>
<script defer type="text/javascript" src="controller.js"></script>
<script type="text/javascript">
var instanceId = location.href.split("wizard-")[1].split('.ht')[0];
console.log("Welcome to the Wizard Remote Control - Client part -> ");
console.log("Hello there. My instance id is -> ", instanceId);
window.addEventListener("load", function () {
initCoordinator(instanceId);
}, false);
console.info("----------------------------------");
console.info("- Wizard Remote Control WEB PART -");
console.info("- Hosted on: -");
console.info("- https://maximumroulette.com -");
console.info("----------------------------------");
var initialRun = true,
justOnce = true,
canvas = null,
url = null,
player = null;
function runStream() {
var wsProtocol = 'ws';
if (window.location.protocol.indexOf("https") != -1) {
wsProtocol = 'wss';
}
canvas = document.getElementById("video-canvas");
url = wsProtocol + "://" + document.location.hostname + ":8082/" + instanceId;
player = new JSMpeg.Player(url, {canvas: canvas});
player.source.shouldAttemptReconnect = false;
player.source.reconnectInterval = 10000;
setTimeout(function() {
player.source.shouldAttemptReconnect = false;
}, 500)
setTimeout(function() {
if (player.isPlaying == false) {
console.info("After 3 secound no connection ...");
}
}, 3000);
window.removeEventListener("click", runStream, false);
}
if (initialRun) {
runStream();
} else {
window.addEventListener("click", runStream, false);
}
</script>
</body>
</html>