-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
423 lines (356 loc) · 13.5 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
<!DOCTYPE html>
<html>
<head>
<title>M&S</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script>if (typeof module === 'object') {window.module = module; module = undefined;}</script>
<script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script>
<script>if (window.module) module = window.module;</script>
<!-- We've provide some simple styling to get you started. -->
<link href="VidyoConnector.css" rel="stylesheet" type="text/css" >
<!-- Here we load the application which knows how to
invoke the VidyoConnector API. -->
<script src="VidyoConnector.js"></script>
<script type="text/javascript">
var configParams = {};
var vidyoMediaBridge
function onVidyoClientLoaded(status) {
console.log("Status: " + status.state + "Description: " + status.description);
switch (status.state) {
case "READY": // The library is operating normally
$("#connectionStatus").html("Ready to Connect");
$("#helper").addClass("hidden");
$("#optionsVisibilityButton").removeClass("hidden");
$("#renderer").removeClass("hidden");
$("#toolbarLeft").removeClass("hidden");
$("#toolbarCenter").removeClass("hidden");
$("#toolbarRight").removeClass("hidden");
// If configured to autoJoin, then show video full screen immediately
if (configParams.autoJoin === "1") {
$("#optionsVisibilityButton").addClass("showOptions").removeClass("hideOptions");
$("#renderer").addClass("rendererFullScreen").removeClass("rendererWithOptions");
} else
$("#options").removeClass("hidden");
// After the VidyoClient is successfully initialized a global VC object will become available
// All of the VidyoConnector gui and logic is implemented in VidyoConnector.js
var webrtcExtensionPath = "";
if (VCUtils.params.webrtc === "true") {
if (status.hasOwnProperty("downloadPathWebRTCExtensionFirefox"))
webrtcExtensionPath = status.downloadPathWebRTCExtensionFirefox;
else if (status.hasOwnProperty("downloadPathWebRTCExtensionChrome"))
webrtcExtensionPath = status.downloadPathWebRTCExtensionChrome;
}
StartVidyoConnector(VC, VCUtils.params.webrtc, webrtcExtensionPath, configParams);
break;
case "RETRYING": // The library operating is temporarily paused
$("#connectionStatus").html("Temporarily unavailable retrying in " + status.nextTimeout/1000 + " seconds");
break;
case "FAILED": // The library operating has stopped
ShowFailed(status);
$("#connectionStatus").html("Failed: " + status.description);
break;
case "FAILEDVERSION": // The library operating has stopped
UpdateHelperPaths(status);
ShowFailedVersion(status);
$("#connectionStatus").html("Failed: " + status.description);
break;
case "NOTAVAILABLE": // The library is not available
UpdateHelperPaths(status);
$("#connectionStatus").html(status.description);
break;
}
return true; // Return true to reload the plugins if not available
}
function UpdateHelperPaths(status) {
$("#helperPlugInDownload").attr("href", status.downloadPathPlugIn);
$("#helperAppDownload").attr("href", status.downloadPathApp);
}
function ShowFailed(status) {
var helperText = '';
// Display the error
helperText += '<h2>An error occurred, please reload</h2>';
helperText += '<p>' + status.description + '</p>';
$("#helperText").html(helperText);
$("#failedText").html(helperText);
$("#failed").removeClass("hidden");
}
function ShowFailedVersion(status) {
var helperText = '';
// Display the error
helperText += '<h4>Please Download a new plugIn and restart the browser</h4>';
helperText += '<p>' + status.description + '</p>';
$("#helperText").html(helperText);
}
function loadVidyoClientLibrary(webrtc, plugin) {
// If webrtc, then set webrtcLogLevel
var webrtcLogLevel = "";
if (webrtc) {
// Set the WebRTC log level to either: 'info' (default), 'error', or 'none'
webrtcLogLevel = '&webrtcLogLevel=info';
}
//We need to ensure we're loading the VidyoClient library and listening for the callback.
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://static.vidyo.io/4.1.20.3/javascript/VidyoClient/VidyoClient.js?onload=onVidyoClientLoaded&webrtc=' + webrtc + '&plugin=' + plugin + webrtcLogLevel;
document.getElementsByTagName('head')[0].appendChild(script);
}
function joinViaBrowser() {
loadVidyoClientLibrary(true, false);
}
</script>
</head>
<!-- We execute the VidyoConnectorApp library on page load
to hook up all of the events to elements. -->
<body id="vidyoConnector">
<!-- This button toggles the visibility of the options. -->
<!-- This is the div into which the Vidyo component will be inserted. -->
<div id="renderer" class="rendererWithOptions pluginOverlay hidden">
</div>
<div id="toolbarCenter" class="toolbar hidden">
<!-- This button toggles the camera privacy on or off. -->
<button id="cameraButton" title="Camera Privacy" class="toolbarButton cameraOn"></button>
<!-- This button joins and leaves the conference. -->
<button id="joinLeaveButton" title="Join Conference" class="toolbarButton callStart"></button>
<!-- This button mutes and unmutes the users' microphone. -->
<button id="microphoneButton" title="Microphone Privacy" class="toolbarButton microphoneOn"></button>
</div>
<div id="messages">
<!-- All Vidyo-related messages will be inserted into these spans. -->
<span id="error"></span>
<span id="message"></span>
</div>
</div>
<table>
<tr id="helperPicker">
<td >
<table>
<tr>
<td id="joinViaBrowser" class="hidden">
<div class="helperHeader">
<img src="Images/web.svg" onclick="javascript:joinViaBrowser()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Join the call immediately
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
No downloads or installations
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Good quality
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaBrowser()">Join via the browser</a>
</div>
</td>
<td id="joinViaPlugIn" class="hidden">
<div class="helperHeader">
<img src="Images/download.svg" onclick="javascript:joinViaPlugIn()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Join meetings right from the browser
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Share seamlessly without extensions
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Best quality
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaPlugIn()">Join via the plugin</a>
</div>
</td>
<td id="joinViaApp" class="hidden">
<div class="helperHeader">
<img src="Images/desktop.svg" onclick="javascript:joinViaApp()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Join meetings faster with fewer clicks
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Share seamlessly without extensions
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Best quality
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaApp()">Join via the app</a>
</div>
</td>
<td id="joinViaOtherApp" class="hidden">
<div class="helperHeader">
<img src="Images/download.svg" onclick="javascript:joinViaOtherApp()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Join from any device
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Best quality
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaOtherApp()">Join via the app</a>
</div>
</td>
<td id="joinViaMediaBridge" class="hidden">
<div class="helperHeader">
<img src="Images/mediaBridge.svg" id="dialimage" onclick="javascript:joinViaMediaBridge()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Join meeting from a phone or a device
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Stream meeting externally
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Variable quality
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaMediaBridge()">Join via the bridge</a>
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr id="helperPlugIn" class="hidden">
<td>
<div class="helperHeader">
<img src="Images/download.svg" onclick="javascript:joinViaBrowser()"/>
</div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Download and install it now
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
The plugin will launch automatically once installed
</li>
</ul>
<div class="helperFooter">
<a id="helperPlugInDownload" href="">Download</a>
</div>
</td>
</tr>
<tr id="helperApp" class="hidden">
<td>
<div class="helperHeader">
<img src="Images/download.svg" onclick="javascript:joinViaApp()"/>
</div>
<div><iframe id="helperAppLoader" src="" class="hidden"></iframe></div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Download and install it now
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Launch once installed
</li>
</ul>
<div class="helperFooter">
<a id="helperAppDownload" href="">Download</a>
<a href="javascript:joinViaApp()">Launch</a>
</div>
</td>
</tr>
<tr id="helperOtherApp" class="hidden">
<td>
<div class="helperHeader">
<img src="Images/download.svg" onclick="javascript:joinViaOtherApp()"/>
</div>
<div><iframe id="helperOtherAppLoader" src="" class="hidden"></iframe></div>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Build and install from the SDK
</li>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Launch once installed
</li>
</ul>
<div class="helperFooter">
<a href="javascript:joinViaOtherApp()">Launch</a>
</div>
</td>
</tr>
<tr id="helperMediaBridge" class="options hidden">
<td>
<form>
<ul>
<li class="helperCheck"><img src="Images/checkmark.svg"/>
Enter phone, SIP or RTMP
</li>
<li class="helperCheck center">
<strong>Example:</strong></br>
+12223334444</br>
sip:127.0.0.1:5060</br>
rtmp://youtube.com/stream</br>
</li>
</ul>
<p>
<!-- This is the destination of where the media bridge will connect
-->
<label for="destination">Destination</label>
<input id="mediaBridged_destination" class="destination" type="text" placeholder="phone, SIP or RTMP" value="">
</p>
<div class="optionsParameters">
<p>
<!-- The host of our backend service. -->
<label>Host</label>
<input type="text" id="mediaBridged_host" class="host" value="prod.vidyo.io">
</p>
<p>
<!-- A token that is derived from the deveoper key assigned to your account which will allow access for this particular instance.
The token will contain its expiration date and the user ID.
For more information visit the developer section of http://vidyo.io -->
<label>Token</label>
<input type="text" id="mediaBridged_token" class="token" value="cHJvdmlzaW9uAGZhaGFkQDczYjVjOS52aWR5by5pbwA2MzY4NjkxNzkzNAAAZWFiM2Y4ZTA2MTMwNWFjNmU2MGVlOTU2OWM2YjlhZjdjNDhmOWZlMDk4Nzc5ZTJiMWJmMzY3Yjc1NjFmYjRkNTllZDNiZTVjNTM0Y2VhYzRhOGZkNWE1M2ZlMzU3ODE5">
</p>
<p>
<!-- This is the display name that other users will see.
-->
<label for="displayName">Display Name</label>
<input type="text" id="mediaBridged_displayName" class="displayName" placeholder="Display Name" value="Guest">
</p>
<p>
<!-- This is the "room" or "space" to which you're connecting
the user. Other users who join this same Resource will be able to see and hear each other.
-->
<label for="resourceId">Resource ID</label>
<input type="text" id="mediaBridged_resourceId" class="resourceId" placeholder="Conference Reference" value="demoRoom">
</p>
<input type="hidden" id="mediaBridgeHost" value="gateway.prod.vidyo.io">
<input type="hidden" id="mediaBridged_endpointName" value="MediaBridgeDemo">
</div>
</form>
<div class="helperFooter">
<a href="javascript:connectViaMediaBridge()">Connect</a>
</div>
</td>
</tr>
<tr id="helperMediaBridgeConnected" class="options hidden">
<td>
<p>
</p>
<ul id="mediaBridgeParticipantList">
</ul>
<div class="helperFooter">
<a href="javascript:disconnectViaMediaBridge()">Disconnect</a>
</div>
</td>
</tr>
<tr>
</tr>
</table>
</div>
</body>
<script>
javascript:joinViaBrowser();
</script>
</html>