-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
46 lines (46 loc) · 1.54 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
<!DOCTYPE html>
{% autoescape true %}
<html>
<head>
<link rel="stylesheet" type="text/css" href="/css/room.css">
<script type="text/javascript">
function joinRoom() {
// RoomID must not contain special characters or spaces.
var roomId = document.getElementById ('room_name').value;
var displayName = document.getElementById ('display_name').value;
// Pass on the URL query parameters
if (window.location.search) {
var url = "/" + encodeURIComponent(roomId) + window.location.search + "&displayName=" + encodeURIComponent(displayName)
} else {
var url = "/" + encodeURIComponent(roomId) + "?displayName=" + encodeURIComponent(displayName)
}
// Redirect to the new URL
window.location.href = url;
return false;
};
</script>
</head>
<body>
<img class="logo" src="https://static.vidyo.io/latest/connector/Images/VidyoIcon.png"/>
{% if roomId %}
<h1>What is your name?</h1>
<form onsubmit="return joinRoom()">
<input type="text" name="display_name" id="display_name" placeholder="your name">
<br />
<input type="hidden" name="room_name" id="room_name" value="{{ roomId }}">
<br />
<input type="submit" value="join">
</form>
{% else %}
<h1>What room would you like to join?</h1>
<form onsubmit="return joinRoom()">
<input type="text" name="display_name" id="display_name" placeholder="your name">
<br />
<input type="text" name="room_name" id="room_name" placeholder="room name">
<br />
<input type="submit" value="join">
</form>
{% endif %}
</body>
</html>
{% endautoescape %}