|
@@ -0,0 +1,138 @@
|
|
1
|
+<!DOCTYPE html>
|
|
2
|
+<html>
|
|
3
|
+<head>
|
|
4
|
+ <title>Sala de Espera</title>
|
|
5
|
+ <meta charset="UTF-8">
|
|
6
|
+ <style>
|
|
7
|
+ body {
|
|
8
|
+ display: flex;
|
|
9
|
+ justify-content: center;
|
|
10
|
+ align-items: center;
|
|
11
|
+ background: #06172A;
|
|
12
|
+ height: 100vh;
|
|
13
|
+ margin: 0;
|
|
14
|
+ }
|
|
15
|
+ #content {
|
|
16
|
+ text-align: center;
|
|
17
|
+ color: white;
|
|
18
|
+ font-weight: bold;
|
|
19
|
+ font-size: 24px;
|
|
20
|
+ font-family: arial, sans-serif;
|
|
21
|
+ }
|
|
22
|
+ .spinner {
|
|
23
|
+ margin: 20px auto;
|
|
24
|
+ }
|
|
25
|
+ .spinner .bounce1 {
|
|
26
|
+ animation-delay: -0.32s;
|
|
27
|
+ }
|
|
28
|
+ .spinner .bounce2 {
|
|
29
|
+ animation-delay: -0.16s;
|
|
30
|
+ }
|
|
31
|
+ .spinner > div {
|
|
32
|
+ width: 30px;
|
|
33
|
+ height: 30px;
|
|
34
|
+ background-color: rgb(255, 255, 255);
|
|
35
|
+ display: inline-block;
|
|
36
|
+ border-radius: 100%;
|
|
37
|
+ animation: 1.4s ease-in-out 0s infinite normal both running sk-bouncedelay;
|
|
38
|
+ }
|
|
39
|
+ @-webkit-keyframes sk-bouncedelay {
|
|
40
|
+ 0%, 80%, 100% {
|
|
41
|
+ -webkit-transform: scale(0)
|
|
42
|
+ }
|
|
43
|
+ 40% {
|
|
44
|
+ -webkit-transform: scale(1.0)
|
|
45
|
+ }
|
|
46
|
+ }
|
|
47
|
+
|
|
48
|
+ @keyframes sk-bouncedelay {
|
|
49
|
+ 0%, 80%, 100% {
|
|
50
|
+ -webkit-transform: scale(0);
|
|
51
|
+ transform: scale(0);
|
|
52
|
+ }
|
|
53
|
+ 40% {
|
|
54
|
+ -webkit-transform: scale(1.0);
|
|
55
|
+ transform: scale(1.0);
|
|
56
|
+ }
|
|
57
|
+ }
|
|
58
|
+ </style>
|
|
59
|
+
|
|
60
|
+ <script src="lib/jquery-2.1.1.min.js" type="text/javascript"></script>
|
|
61
|
+
|
|
62
|
+ <script type="text/javascript">
|
|
63
|
+ function updateMessage(message) {
|
|
64
|
+ $('#content > p').html(message);
|
|
65
|
+ }
|
|
66
|
+
|
|
67
|
+ function findSessionToken() {
|
|
68
|
+ return location.search
|
|
69
|
+ .substr(1)
|
|
70
|
+ .split('&')
|
|
71
|
+ .find(function(item) {
|
|
72
|
+ return item.split('=')[0] === 'sessionToken'
|
|
73
|
+ });
|
|
74
|
+ };
|
|
75
|
+
|
|
76
|
+ function fetchGuestWait(sessionToken) {
|
|
77
|
+ const GUEST_WAIT_ENDPOINT = '/bigbluebutton/api/guestWait';
|
|
78
|
+
|
|
79
|
+ return $.get(GUEST_WAIT_ENDPOINT, sessionToken.concat('&redirect=false'));
|
|
80
|
+ };
|
|
81
|
+
|
|
82
|
+ function pollGuestStatus(token, attempt, limit, everyMs) {
|
|
83
|
+ setTimeout(function() {
|
|
84
|
+ var REDIRECT_STATUSES = ['ALLOW', 'DENY'];
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+ if (attempt >= limit) {
|
|
88
|
+ updateMessage('No respons from Moderator');
|
|
89
|
+ return;
|
|
90
|
+ }
|
|
91
|
+
|
|
92
|
+ fetchGuestWait(token).always(function(data) {
|
|
93
|
+ console.log("data=" + JSON.stringify(data));
|
|
94
|
+ var status = data.response.guestStatus;
|
|
95
|
+
|
|
96
|
+ if (REDIRECT_STATUSES.includes(status)) {
|
|
97
|
+ window.location = data.response.url;
|
|
98
|
+ return;
|
|
99
|
+ }
|
|
100
|
+
|
|
101
|
+ return pollGuestStatus(token, attempt + 1, limit, everyMs);
|
|
102
|
+ })
|
|
103
|
+ }, everyMs);
|
|
104
|
+ };
|
|
105
|
+
|
|
106
|
+ window.onload = function() {
|
|
107
|
+ try {
|
|
108
|
+ var ATTEMPT_EVERY_MS = 5000;
|
|
109
|
+ var ATTEMPT_LIMIT = 100;
|
|
110
|
+
|
|
111
|
+ var sessionToken = findSessionToken();
|
|
112
|
+
|
|
113
|
+ if(!sessionToken) {
|
|
114
|
+ updateMessage('No session Token received');
|
|
115
|
+ return;
|
|
116
|
+ }
|
|
117
|
+
|
|
118
|
+ pollGuestStatus(sessionToken, 0, ATTEMPT_LIMIT, ATTEMPT_EVERY_MS);
|
|
119
|
+ } catch (e) {
|
|
120
|
+ console.error(e);
|
|
121
|
+ updateMessage('Error: more details in the console');
|
|
122
|
+ }
|
|
123
|
+ };
|
|
124
|
+ </script>
|
|
125
|
+</head>
|
|
126
|
+
|
|
127
|
+<body>
|
|
128
|
+ <div id="content">
|
|
129
|
+ <div class="spinner">
|
|
130
|
+ <div class="bounce1"></div>
|
|
131
|
+ <div class="bounce2"></div>
|
|
132
|
+ <div class="bounce3"></div>
|
|
133
|
+ </div>
|
|
134
|
+ <p>Por favor, espere a que un moderador lo apruebe para unirse a la sala.</p>
|
|
135
|
+ </div>
|
|
136
|
+</body>
|
|
137
|
+
|
|
138
|
+</html>
|