-
Notifications
You must be signed in to change notification settings - Fork 2
/
video_chat_room.html
93 lines (83 loc) · 3.04 KB
/
video_chat_room.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
<html>
<head>
<script src="https://meet.jit.si/external_api.js"></script>
<link rel="icon" type="image/png" href="images/video_favicon_32x32.png"/>
<title id="title">Video Chat Room</title>
<style>
body { padding:0; margin: 0; font-family: sans-serif; }
div#meet { position: relative; }
div#header {
position: absolute;
top: 20px;
left: 0;
right: 0;
width: 50%;
margin: 0 auto;
text-align: center;
font-size: 200%;
font-weight: bold;
background-color: rgba(0, 0, 0, 0.5);
color: white;
}
</style>
</head>
<body id="meet">
<div id="header">Video Chat Room</h1>
</body>
<script>
window.onload = function() {
const urlParams = new URLSearchParams(window.location.search);
const room = urlParams.get('room_id');
const name = urlParams.get('name');
const pid = urlParams.get('pid');
const uid = urlParams.get('uid');
if (pid && uid && opener && opener.set_puzzle_active) {
console.log("... setting puzzle active with pid/uid:", pid, uid);
opener.set_puzzle_active(pid, uid)
}
document.getElementById('header').innerText = name
document.getElementById('title').innerText = name
const jitsi_options = {
roomName: room,
parentNode: document.querySelector('#meet'),
configOverwrite: {
enableLobbyChat: false,
startWithAudioMuted: true,
toolbarButtons: [
'microphone', 'camera', 'closedcaptions', 'desktop', 'fullscreen',
'fodeviceselection', 'hangup', 'profile', 'sharedvideo',
'settings', 'raisehand', 'videoquality', 'filmstrip', 'feedback',
'stats', 'shortcuts', 'tileview', 'videobackgroundblur',
'download', 'help', 'mute-everyone',
],
welcomePage: { disabled: true },
},
interfaceConfigOverwrite: {
TOOLBAR_BUTTONS: [
'microphone', 'camera', 'closedcaptions', 'desktop', 'fullscreen',
'fodeviceselection', 'hangup', 'profile', 'sharedvideo',
'settings', 'raisehand', 'videoquality', 'filmstrip', 'feedback',
'stats', 'shortcuts', 'tileview', 'videobackgroundblur',
'download', 'help', 'mute-everyone',
],
LANG_DETECTION: false,
DEFAULT_REMOTE_DISPLAY_NAME: "Random Puzzler",
SHOW_CHROME_EXTENSION_BANNER: false,
}
};
console.log("... starting jit.si", jitsi_options);
const api = new JitsiMeetExternalAPI('meet.jit.si', jitsi_options);
console.log("... setting jit.si room subject:", name);
api.executeCommand('subject', name);
api.addListener("readyToClose", function() { window.close(); });
// Apparently in the current version of Jitsi, chat is _off_ by default.
// api.executeCommand('toggleChat');
}
window.onunload = window.onbeforeunload = function() {
if (pid && uid && opener && opener.set_puzzle_inactive) {
console.log("... setting puzzle INactive with pid/uid:", pid, uid);
opener.set_puzzle_inactive(pid, uid)
}
}
</script>
</html>