forked from PeterJCLaw/srcomp-screens
-
Notifications
You must be signed in to change notification settings - Fork 0
/
staging.html
71 lines (59 loc) · 2.28 KB
/
staging.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>SR Staging Screen</title>
<script src="bower_components/webcomponentsjs/webcomponents.js"></script>
<link rel="import" href="components/sr-comp/component.html" />
<link rel="import" href="components/sr-staging/component.html" />
<style>
body {
position: fixed;
width: 100%;
height: 100%;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: 0;
padding: 0;
font-family: 'Open Sans', sans-serif;
background: black;
color: white;
font-size: 100%;
}
#staging {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<sr-comp id="comp"></sr-comp>
<sr-staging id="staging"></sr-staging>
<script>
document.addEventListener('sr-ready', function() {
var comp = document.querySelector('#comp');
var staging = document.querySelector('#staging');
staging.hidden = false;
staging.comp = comp;
/* Work around an issue with Firefox. When the arena
fields above are set, the changed callback should
get called immediately giving time for listeners to
be registered on the stream before it is loaded
below. However, in Firefox, the changed callbacks
happen *after* this call below. Therefore, we wrap
it in a 'setTimeout' to ensure it happens in the
next tick, after the changed callbacks.
Rather concerningly, using a value of 0ms in the
'setTimeout' doesn't solve the problem. Therefore
the 500ms as it is currently might have to be
increased for the Raspberry Pis which have a lower
processing speed than my laptop. */
setTimeout(function() {
comp.stream.load();
}, 500);
});
</script>
</body>
</html>