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
394
395
396
397
398
399
400
401
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Jitsi URL Generator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-F3w7mX95PdgyTmZZMECAngseQB83DfGTowi0iMjiWaeVhAn4FJkqJByhZMI3AhiU" crossorigin="anonymous">
<link href="style.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-/bQdsTh/da6pkI1MST/rWKFNjaCP5gBSY4sEBT38Q/9RBh9AH40zEOg7Hlq2THRZ"
crossorigin="anonymous"></script>
<script src="roomname_generator.js"></script>
<script src="jitsi_url_generator.js"></script>
<script>
const DEFAULT_DOMAIN = "meet.jit.si";
const DEFAULT_ROOM_NAME = randomRoomName();
$(document).ready(function () {
const generator = makeUrlGenerator(function (url) {
$('#url').attr('href', url).text(url);
}, DEFAULT_DOMAIN, DEFAULT_ROOM_NAME);
// Handle changes to Jitsi Hostname
$('#jitsiDomain')
.val(DEFAULT_DOMAIN)
.on("input", function () {
generator.updateDomain(this.value);
});
// Handle changes to room name
$('#roomName')
.val(DEFAULT_ROOM_NAME)
.on("input", function () {
let value = this.value.replace(/[^0-9a-z_.\-]/gi, ''); // sanitize
this.value = value;
generator.updateRoomName(value);
});
// Regenerate random room name
$('#monster').on('click', function () {
$('#roomName').val(randomRoomName()).trigger("input");
});
// Handle user profile changes
const $userInfoDisplayName = $("#userInfoDisplayName");
const $userInfoEmail = $("#userInfoEmail");
const $codeUserInfo = $("#codeUserInfo");
function userProfileChanged() {
let paramGroup = {};
let displayName = $userInfoDisplayName.val().trim();
let email = $userInfoEmail.val().trim();
if (displayName) {
paramGroup['userInfo.displayName'] = '"' + encodeURIComponent(displayName) + '"';
}
if (email) {
paramGroup['userInfo.email'] = '"' + encodeURIComponent(email) + '"';
}
$codeUserInfo.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('userInfo', paramGroup);
}
$userInfoDisplayName.on("input", userProfileChanged);
$userInfoEmail.on("input", userProfileChanged);
// Handle feature changes
const $disablePrejoinPage = $("#disablePrejoinPage");
const $startAudioMuted = $("#startAudioMuted");
const $startVideoMuted = $("#startVideoMuted");
const $disableNotifications = $("#disableNotifications");
const $codeFeatures = $("#codeFeatures");
function featureChanged() {
let paramGroup = {};
if ($disablePrejoinPage.prop('checked')) {
paramGroup['config.prejoinPageEnabled'] = false;
}
if ($startAudioMuted.prop('checked')) {
paramGroup['config.startWithAudioMuted'] = true;
}
if ($startVideoMuted.prop('checked')) {
paramGroup['config.startWithVideoMuted'] = true;
}
if ($disableNotifications.prop('checked')) {
paramGroup['config.notifications'] = '[]';
}
$codeFeatures.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('features', paramGroup);
}
$disablePrejoinPage.on("input", featureChanged);
$startAudioMuted.on("input", featureChanged);
$startVideoMuted.on("input", featureChanged);
$disableNotifications.on("input", featureChanged);
// Handle custom toolbars
const TOOLBAR_ITEMS = [ // use array instead of object so we can influence display order.
["microphone", "Microphone"],
["camera", "Camera"],
["desktop", "Screenshare"],
["hangup", "Leave Meeting"],
["chat", "Chat"],
["raisehand", "Raise Hand"],
["participants-pane", "Participants"],
["tileview", "Toggle Tile View"],
["toggle-camera", "Toggle Camera"],
["profile", "Profile"],
["invite", "Invite"],
["videoquality", "Manage Video Quality"],
["fullscreen", "View Full Screen"],
["security", "Security Options"],
["recording", "Recording"],
["livestreaming", "Live Streaming"],
["closedcaptions", "Closed Caption"],
["etherpad", "Etherpad"],
["mute-everyone", "Mute Everyone"],
["mute-video-everyone", "Disable Everyone's Camera"],
["sharedvideo", "Share Video"],
["shareaudio", "Share Audio"],
["select-background", "Select Background"],
["stats", "Speaker Stats"],
["settings", "Settings"],
["shortcuts", "View Shortcuts"],
["embedmeeting", "Embed Meeting"],
["feedback", "Leave Feedback"],
["help", "Help"],
["download", "Download App"],
["filmstrip", "Filmstrip"],
];
let $toolbarCheckboxContainer = $('#toolbarCheckboxContainer');
let $codeToolbar = $('#codeToolbar');
function toolbarChanged() {
let paramGroup = {};
let $checkedFeatures = $('.feature-checkbox:checked');
if ($checkedFeatures.length !== $('.feature-checkbox').length) { // if not all selected
let selected = [];
$checkedFeatures.each(function () {
selected.push($(this).data('key'));
});
paramGroup['config.toolbarButtons'] = (selected.length === 0) ? '[]' : '["' + selected.join('","') + '"]';
}
$codeToolbar.text(flattenParamGroup(paramGroup).join('&'));
generator.updateParamGroup('toolbar', paramGroup);
}
function updateAllToolbarItems(enabled) {
$('.feature-checkbox').each(function () {
$(this).prop('checked', enabled);
});
toolbarChanged();
}
TOOLBAR_ITEMS.forEach(function (pair) {
let key = pair[0], description = pair[1];
let id = 't_' + key;
let checkbox = $('<input>', {
class: 'form-check-input feature-checkbox',
type: 'checkbox',
id: id
})
.prop('checked', true)
.data('key', key)
.on('change', toolbarChanged);
$('<div>', { class: "form-check form-switch" }).append(checkbox).append(
$('<label>', { class: 'form-check-label', for: id }).text(description)
).appendTo($toolbarCheckboxContainer);
});
$('#enableAllToolbarItems').on('click', function () {
updateAllToolbarItems(true);
});
$('#disableAllToolbarItems').on('click', function () {
updateAllToolbarItems(false);
});
});
</script>
</head>
<body>
<div class="px-4 py-3 my-3 text-center">
<h1 class="display-5 fw-bold">Jitsi URL Generator</h1>
<div class="col-lg-6 mx-auto mt-5">
<div class="mb-3 row">
<label for="jitsiDomain" class="col-sm-4 col-form-label">Jitsi Hostname</label>
<div class="col-sm-8">
<input type="text" class="form-control" id="jitsiDomain">
</div>
</div>
<div class="mb-3 row">
<label for="roomName" class="col-sm-4 col-form-label">Room Name</label>
<div class="col-sm-8">
<div class="input-group mb-3">
<input type="text" class="form-control" id="roomName">
<span class="input-group-text" id="monster">
<img
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABmJLR0QA/wD/AP+gvaeTAAAB00lEQVRIie3UPWtVQRAG4CeawmCpXMH4EQgWIX43gmAKLazEysbO/AALf0BE7CzVWkOKCxe1Ma0plZhCVPAiihAkEhQ1jQYFvddi5ySbw7nHRDvxhWX2zHlnZmdnZvnXsIQuBjPdUdxEG19itXEDRzLeYNgu1QVoBWkKuzCJTuiqVge3wvlU6Fq5w75SgIN4hK2ZbhlNzOFj6LbjGM5jION+xXE87xWAdCX341TzuIzPPTLehivYiwWcxZOcsKmH4c44eZ1z+BScb2HTKROqAoxLmTV/4zwP0gxf4+sJcCrkXMhrscrI9bMl2xX0VxjuDlkUtOiYMnJ9wd1TJpWL3MD72J+pcFqH6ZA78KFQ5lfUwEzs2xt0ntvMhC+sZtDAAxzAK0xIPZ3jttT/pCu5UPo/IHXUKF7iJBY3x4+H2B+nmJBatIyF4CxLT8di6f8PaUhHMYLTmOyLLOalAl2M/SE8rQhSh8N4hiFcx1sM9UudcBeXcE4amGEbL/JVvMG7+L6HblHkOyFPhPM/xTDGYt9idQ4eSyl9x74Kw+kKHdVZvsYWMahFgG6QX0jF+huMSM3QzQOQPbE1KNq6arIL/JSKvcYgR53xegKs8dnruf6PFfwC6NhvLfV5B6cAAAAASUVORK5CYII="/>
</span>
</div>
</div>
</div>
</div>
<div class="col-lg-8 mx-auto mt-3">
<div class="fs-4">
<code>
<a id="url" class="url" href='' target="jitsiUrlGenerator"></a>
</code>
</div>
</div>
</div>
<div class="divider"></div>
<div class="container my-5">
<div class="row">
<div class="col">
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title mb-4">User Profile</h5>
<label for="userInfoDisplayName" class="col-sm-4 ol-form-label">Display Name</label>
<input type="text" class="form-control" id="userInfoDisplayName" value="">
<label for="userInfoEmail" class="col-form-label">Email</label>
<input type="email" class="form-control" id="userInfoEmail" value="">
</div>
<div class="card-footer">
<div style="width:400px;max-width:400px">
<code id="codeUserInfo"></code>
</div>
</div>
</div>
<div class="card mb-4">
<div class="card-body">
<h5 class="card-title mb-4">Features</h5>
<div class="form-check mb-4">
<input class="form-check-input" type="checkbox" value="" id="disablePrejoinPage">
<label class="form-check-label" for="disablePrejoinPage">
Disable PreJoin page
</label>
<br/>
<small class="text-muted">
By default, users start at prejoin page where they enter their display name and update settings
before joining a meeting. Select this to skip that page.
</small>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="startAudioMuted">
<label class="form-check-label" for="startAudioMuted">
Start with Audio Muted
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="startVideoMuted">
<label class="form-check-label" for="startVideoMuted">
Start with Camera off
</label>
</div>
<div class="form-check mt-4">
<input class="form-check-input" type="checkbox" value="" id="disableNotifications">
<label class="form-check-label" for="disableNotifications">
Disable all notifications
</label>
</div>
</div>
<div class="card-footer">
<div style="width:400px;max-width:400px">
<code id="codeFeatures"></code>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card">
<div class="card-body">
<h5 class="card-title mb-4">Customise Toolbar Buttons</h5>
<div id="toolbarCheckboxContainer"></div>
<div class="my-3 text-center">
<button type="button" class="btn btn-sm btn-outline-primary mx-2" id="enableAllToolbarItems">Enable all
</button>
<button type="button" class="btn btn-sm btn-outline-secondary mx-2" id="disableAllToolbarItems">Disable
all
</button>
</div>
<div class="mt-3">
<small class="text-muted" style="width:400px;max-width:400px">
Things to note:
<ul>
<li>Not all items are displayed even if selected as some will depend on whether the feature is enabled,
the user role, or even the user device.
</li>
<li>
It is not possible to change the order of items in the toolbar.
</li>
<li>
It is not possible to contorl which items end up in the "More actions" menu.
</li>
</ul>
</small>
</div>
</div>
<div class="card-footer">
<div style="width:400px;max-width:400px">
<code id="codeToolbar"></code>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="divider"></div>
<div class="bg-dark text-white px-4 py-5">
<div class="col-lg-6 mx-auto">
<div class="fs-6 mb-4">
<p>
👋 Hi there. I hope you found this useful.
</p>
<p>
Do note that this page exposes only a small subset of url-based
config overrides afforded by Jitsi. It also makes assumptions about default config values as configured on
<a href="https://meet.jit.si">meet.jit.si</a>.
</p>
<p>
The intent of this page is to simply illustrate how options should be formatted and composed, and offer
examples of some of the more common settings.
</p>
<p>
For a complete list, see
<a href="https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/config/configWhitelist.js">
configWhitelist.js</a>
and
<a href="https://github.com/jitsi/jitsi-meet/blob/master/react/features/base/config/interfaceConfigWhitelist.js">
interfaceConfigWhitelist.js</a>
for a complete list of whitelisted configs. Also see the
<a href="https://github.com/jitsi/jitsi-meet/blob/master/config.js">
config.js</a>
and
<a href="https://github.com/jitsi/jitsi-meet/blob/master/interface_config.js">
interface_config.js</a>
config templates which will contain description of each option and their defaults.
</p>
<p>
If you spot any issues or outdated options, do feel free to
<a href="https://github.com/shawnchin/jitsi-url-generator">send a me PR</a> :)
</p>
</div>
</div>
</div>
</div>
</body>
</html>
|