-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogEpisodeController.js
More file actions
62 lines (52 loc) · 1.87 KB
/
progEpisodeController.js
File metadata and controls
62 lines (52 loc) · 1.87 KB
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
var sectionOrder = [];
var currentSection = 0;
function controlPlay() {
if (currentSection < sectionOrder.length) {
firebase.database().ref(episodePath + "/sessions/" + getURLParameter("session")).set({
command: "scrollSection",
sectionKey: sectionOrder[currentSection]
});
}
}
function controlStop() {
firebase.database().ref(episodePath + "/sessions/" + getURLParameter("session")).set({
command: "stopSection"
});
}
function controlPrevious() {
if (currentSection > 0) {
currentSection--;
}
firebase.database().ref(episodePath + "/sessions/" + getURLParameter("session")).set({
command: "jumpToSection",
sectionKey: sectionOrder[currentSection]
});
}
function controlNext() {
if (currentSection + 1 < sectionOrder.length) {
currentSection++;
}
firebase.database().ref(episodePath + "/sessions/" + getURLParameter("session")).set({
command: "jumpToSection",
sectionKey: sectionOrder[currentSection]
});
}
function controlRestart() {
currentSection = 0;
firebase.database().ref(episodePath + "/sessions/" + getURLParameter("session")).set({
command: "jumpToSection",
sectionKey: sectionOrder[currentSection]
});
}
events.userReady.push(function() {
if (getURLParameter("prog") != null && getURLParameter("episode") != null && getURLParameter("session") != null) {
$(".virtualTeleprompter").attr("src",
"progEpisodeDisplay.html?prog=" + encodeURIComponent(getURLParameter("prog")) +
"&episode=" + encodeURIComponent(getURLParameter("episode")) +
"&session=" + encodeURIComponent(getURLParameter("session"))
);
}
firebase.database().ref(episodePath + "/content/script").on("value", function(snapshot) {
sectionOrder = snapshot.val().sectionOrder;
});
});