[mirotalksfu] - fix rules
هذا الالتزام موجود في:
@@ -79,6 +79,7 @@ let peer_name = getPeerName();
|
||||
let peer_uuid = getPeerUUID();
|
||||
let isScreenAllowed = getScreen();
|
||||
let notify = getNotify();
|
||||
isPresenter = isPeerPresenter();
|
||||
|
||||
let peer_info = null;
|
||||
|
||||
@@ -412,6 +413,21 @@ function getNotify() {
|
||||
return true;
|
||||
}
|
||||
|
||||
function isPeerPresenter() {
|
||||
let qs = new URLSearchParams(window.location.search);
|
||||
let presenter = filterXSS(qs.get('isPresenter'));
|
||||
if (presenter) {
|
||||
presenter = presenter.toLowerCase();
|
||||
let queryPresenter = presenter === '1' || presenter === 'true';
|
||||
if (queryPresenter != null) {
|
||||
console.log('Direct join Reconnect', { isPresenter: queryPresenter });
|
||||
return queryPresenter;
|
||||
}
|
||||
}
|
||||
console.log('Direct join Reconnect', { presenter: true });
|
||||
return true;
|
||||
}
|
||||
|
||||
function getPeerName() {
|
||||
const qs = new URLSearchParams(window.location.search);
|
||||
const name = filterXSS(qs.get('name'));
|
||||
|
||||
@@ -318,7 +318,8 @@ class RoomClient {
|
||||
for (let peer of Array.from(peers.keys()).filter((id) => id == this.peer_id)) {
|
||||
let my_peer_info = peers.get(peer).peer_info;
|
||||
console.log('07.1 ----> My Peer info', my_peer_info);
|
||||
isPresenter = my_peer_info.peer_presenter;
|
||||
isPresenter = window.localStorage.isReconnected === 'true' ? isPresenter : my_peer_info.peer_presenter;
|
||||
window.localStorage.isReconnected = false;
|
||||
handleRules(isPresenter);
|
||||
}
|
||||
adaptAspectRatio(participantsCount);
|
||||
@@ -521,11 +522,6 @@ class RoomClient {
|
||||
participantsCount = data.peer_counts;
|
||||
adaptAspectRatio(participantsCount);
|
||||
if (isParticipantsListOpen) getRoomParticipants(true);
|
||||
if (participantsCount == 1) {
|
||||
isPresenter = true;
|
||||
handleRules(isPresenter);
|
||||
console.log('I am alone in the room, got Presenter Rules');
|
||||
}
|
||||
}.bind(this),
|
||||
);
|
||||
|
||||
@@ -664,7 +660,7 @@ class RoomClient {
|
||||
console.log('Connected to signaling server!');
|
||||
this._isConnected = true;
|
||||
// location.reload();
|
||||
getPeerName() ? location.reload() : openURL(this.getDirectJoinURL());
|
||||
getPeerName() ? location.reload() : openURL(this.getReconnectDirectJoinURL());
|
||||
}.bind(this),
|
||||
);
|
||||
|
||||
@@ -683,6 +679,7 @@ class RoomClient {
|
||||
|
||||
ServerAway() {
|
||||
this.sound('alert');
|
||||
window.localStorage.isReconnected = true;
|
||||
Swal.fire({
|
||||
allowOutsideClick: false,
|
||||
allowEscapeKey: false,
|
||||
@@ -702,8 +699,8 @@ class RoomClient {
|
||||
});
|
||||
}
|
||||
|
||||
getDirectJoinURL() {
|
||||
return `${window.location.origin}/join?room=${this.room_id}&password=${this.RoomPassword}&name=${this.peer_name}&audio=${this.peer_info.peer_audio}&video=${this.peer_info.peer_video}&screen=${this.peer_info.peer_screen}¬ify=0`;
|
||||
getReconnectDirectJoinURL() {
|
||||
return `${window.location.origin}/join?room=${this.room_id}&password=${this.RoomPassword}&name=${this.peer_name}&audio=${this.peer_info.peer_audio}&video=${this.peer_info.peer_video}&screen=${this.peer_info.peer_screen}¬ify=0&isPresenter=${isPresenter}`;
|
||||
}
|
||||
|
||||
// ####################################################
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم