[mirotalksfu] - improve direct join

هذا الالتزام موجود في:
Miroslav Pejic
2023-03-29 13:56:24 +02:00
الأصل d0d26d5842
التزام 818512665f

عرض الملف

@@ -187,7 +187,11 @@ function initClient() {
setupInitVideoSize(); setupInitVideoSize();
} }
setupWhiteboard(); setupWhiteboard();
initEnumerateDevices(); if (peer_name) {
whoAreYou();
} else {
initEnumerateDevices();
}
} }
// #################################################### // ####################################################
@@ -213,6 +217,7 @@ function getRoomId() {
if (roomId == '') { if (roomId == '') {
roomId = makeId(12); roomId = makeId(12);
} }
console.log('Direct join', { room: roomId });
return roomId; return roomId;
} }
@@ -375,9 +380,12 @@ function getScreen() {
if (screen) { if (screen) {
screen = screen.toLowerCase(); screen = screen.toLowerCase();
let queryScreen = screen === '1' || screen === 'true'; let queryScreen = screen === '1' || screen === 'true';
if (queryScreen != null && (navigator.getDisplayMedia || navigator.mediaDevices.getDisplayMedia)) if (queryScreen != null && (navigator.getDisplayMedia || navigator.mediaDevices.getDisplayMedia)) {
console.log('Direct join', { screen: queryScreen });
return queryScreen; return queryScreen;
}
} }
console.log('Direct join', { screen: false });
return false; return false;
} }
@@ -387,8 +395,12 @@ function getNotify() {
if (notify) { if (notify) {
notify = notify.toLowerCase(); notify = notify.toLowerCase();
let queryNotify = notify === '1' || notify === 'true'; let queryNotify = notify === '1' || notify === 'true';
if (queryNotify != null) return queryNotify; if (queryNotify != null) {
console.log('Direct join', { notify: queryNotify });
return queryNotify;
}
} }
console.log('Direct join', { notify: true });
return true; return true;
} }
@@ -396,8 +408,10 @@ function getPeerName() {
const qs = new URLSearchParams(window.location.search); const qs = new URLSearchParams(window.location.search);
const name = filterXSS(qs.get('name')); const name = filterXSS(qs.get('name'));
if (isHtml(name)) { if (isHtml(name)) {
console.log('Direct join', { name: 'Invalid name' });
return 'Invalid name'; return 'Invalid name';
} }
console.log('Direct join', { name: name });
return name; return name;
} }
@@ -409,6 +423,7 @@ function getRoomPassword() {
if (queryNoRoomPassword) { if (queryNoRoomPassword) {
roomPassword = false; roomPassword = false;
} }
console.log('Direct join', { password: roomPassword });
return roomPassword; return roomPassword;
} }
} }
@@ -581,6 +596,10 @@ function checkMedia() {
let queryPeerVideo = video === '1' || video === 'true'; let queryPeerVideo = video === '1' || video === 'true';
if (queryPeerVideo != null) isVideoAllowed = queryPeerVideo; if (queryPeerVideo != null) isVideoAllowed = queryPeerVideo;
} }
console.log('Direct join', {
audio: isAudioAllowed,
video: isVideoAllowed,
});
} }
// #################################################### // ####################################################