[mirotalksfu] - keep lobby, pitch_bar, sounds config on join room
هذا الالتزام موجود في:
@@ -801,21 +801,6 @@ function startServer() {
|
|||||||
log.debug('User joined', data);
|
log.debug('User joined', data);
|
||||||
roomList.get(socket.room_id).addPeer(new Peer(socket.id, data));
|
roomList.get(socket.room_id).addPeer(new Peer(socket.id, data));
|
||||||
|
|
||||||
if (roomList.get(socket.room_id).isLocked()) {
|
|
||||||
log.debug('User rejected because room is locked');
|
|
||||||
return cb('isLocked');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (roomList.get(socket.room_id).isLobbyEnabled()) {
|
|
||||||
log.debug('User waiting to join room because lobby is enabled');
|
|
||||||
roomList.get(socket.room_id).broadCast(socket.id, 'roomLobby', {
|
|
||||||
peer_id: data.peer_info.peer_id,
|
|
||||||
peer_name: data.peer_info.peer_name,
|
|
||||||
lobby_status: 'waiting',
|
|
||||||
});
|
|
||||||
return cb('isLobby');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(socket.room_id in presenters)) presenters[socket.room_id] = {};
|
if (!(socket.room_id in presenters)) presenters[socket.room_id] = {};
|
||||||
|
|
||||||
const peer_name = roomList.get(socket.room_id).getPeers()?.get(socket.id)?.peer_info?.peer_name;
|
const peer_name = roomList.get(socket.room_id).getPeers()?.get(socket.id)?.peer_info?.peer_name;
|
||||||
@@ -846,6 +831,21 @@ function startServer() {
|
|||||||
peer_presenter: isPresenter,
|
peer_presenter: isPresenter,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (roomList.get(socket.room_id).isLocked()) {
|
||||||
|
log.debug('User rejected because room is locked');
|
||||||
|
return cb('isLocked');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (roomList.get(socket.room_id).isLobbyEnabled()) {
|
||||||
|
log.debug('User waiting to join room because lobby is enabled');
|
||||||
|
roomList.get(socket.room_id).broadCast(socket.id, 'roomLobby', {
|
||||||
|
peer_id: data.peer_info.peer_id,
|
||||||
|
peer_name: data.peer_info.peer_name,
|
||||||
|
lobby_status: 'waiting',
|
||||||
|
});
|
||||||
|
return cb('isLobby');
|
||||||
|
}
|
||||||
|
|
||||||
cb(roomList.get(socket.room_id).toJson());
|
cb(roomList.get(socket.room_id).toJson());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ class LocalStorage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
this.SFU_SETTINGS = {
|
this.SFU_SETTINGS = {
|
||||||
|
lobby: false,
|
||||||
|
pitch_bar: true,
|
||||||
|
sounds: true,
|
||||||
video_obj_fit: 2, // cover
|
video_obj_fit: 2, // cover
|
||||||
video_controls: 0, // off
|
video_controls: 0, // off
|
||||||
theme: 0, // dark
|
theme: 0, // dark
|
||||||
|
|||||||
@@ -1344,18 +1344,24 @@ function handleSelects() {
|
|||||||
lS.setLocalStorageDevices(lS.MEDIA_TYPE.speaker, initSpeakerSelect.selectedIndex, initSpeakerSelect.value);
|
lS.setLocalStorageDevices(lS.MEDIA_TYPE.speaker, initSpeakerSelect.selectedIndex, initSpeakerSelect.value);
|
||||||
};
|
};
|
||||||
// room
|
// room
|
||||||
switchPitchBar.onchange = (e) => {
|
|
||||||
isPitchBarEnabled = e.currentTarget.checked;
|
|
||||||
rc.roomMessage('pitchBar', isPitchBarEnabled);
|
|
||||||
};
|
|
||||||
switchSounds.onchange = (e) => {
|
|
||||||
isSoundEnabled = e.currentTarget.checked;
|
|
||||||
rc.roomMessage('sounds', isSoundEnabled);
|
|
||||||
};
|
|
||||||
switchLobby.onchange = (e) => {
|
switchLobby.onchange = (e) => {
|
||||||
isLobbyEnabled = e.currentTarget.checked;
|
isLobbyEnabled = e.currentTarget.checked;
|
||||||
rc.roomAction(isLobbyEnabled ? 'lobbyOn' : 'lobbyOff');
|
rc.roomAction(isLobbyEnabled ? 'lobbyOn' : 'lobbyOff');
|
||||||
rc.lobbyToggle();
|
rc.lobbyToggle();
|
||||||
|
lsSettings.lobby = isLobbyEnabled;
|
||||||
|
lS.setSettings(lsSettings);
|
||||||
|
};
|
||||||
|
switchPitchBar.onchange = (e) => {
|
||||||
|
isPitchBarEnabled = e.currentTarget.checked;
|
||||||
|
rc.roomMessage('pitchBar', isPitchBarEnabled);
|
||||||
|
lsSettings.pitch_bar = isPitchBarEnabled;
|
||||||
|
lS.setSettings(lsSettings);
|
||||||
|
};
|
||||||
|
switchSounds.onchange = (e) => {
|
||||||
|
isSoundEnabled = e.currentTarget.checked;
|
||||||
|
rc.roomMessage('sounds', isSoundEnabled);
|
||||||
|
lsSettings.sounds = isSoundEnabled;
|
||||||
|
lS.setSettings(lsSettings);
|
||||||
};
|
};
|
||||||
// styling
|
// styling
|
||||||
BtnAspectRatio.onchange = () => {
|
BtnAspectRatio.onchange = () => {
|
||||||
@@ -1464,6 +1470,10 @@ function handleInputs() {
|
|||||||
// ####################################################
|
// ####################################################
|
||||||
|
|
||||||
function loadSettingsFromLocalStorage() {
|
function loadSettingsFromLocalStorage() {
|
||||||
|
isPitchBarEnabled = lsSettings.pitch_bar;
|
||||||
|
isSoundEnabled = lsSettings.sounds;
|
||||||
|
switchPitchBar.checked = isPitchBarEnabled;
|
||||||
|
switchSounds.checked = isSoundEnabled;
|
||||||
BtnVideoObjectFit.selectedIndex = lsSettings.video_obj_fit;
|
BtnVideoObjectFit.selectedIndex = lsSettings.video_obj_fit;
|
||||||
BtnVideoControls.selectedIndex = lsSettings.video_controls;
|
BtnVideoControls.selectedIndex = lsSettings.video_controls;
|
||||||
BtnsBarPosition.selectedIndex = lsSettings.buttons_bar;
|
BtnsBarPosition.selectedIndex = lsSettings.buttons_bar;
|
||||||
|
|||||||
@@ -2034,8 +2034,8 @@ class RoomClient {
|
|||||||
exit(offline = false) {
|
exit(offline = false) {
|
||||||
let clean = function () {
|
let clean = function () {
|
||||||
this._isConnected = false;
|
this._isConnected = false;
|
||||||
this.consumerTransport.close();
|
if (this.consumerTransport) this.consumerTransport.close();
|
||||||
this.producerTransport.close();
|
if (this.producerTransport) this.producerTransport.close();
|
||||||
this.socket.off('disconnect');
|
this.socket.off('disconnect');
|
||||||
this.socket.off('newProducers');
|
this.socket.off('newProducers');
|
||||||
this.socket.off('consumerClosed');
|
this.socket.off('consumerClosed');
|
||||||
|
|||||||
@@ -101,6 +101,10 @@ function handleRules(isPresenter) {
|
|||||||
BUTTONS.consumerVideo.muteVideoButton = true;
|
BUTTONS.consumerVideo.muteVideoButton = true;
|
||||||
BUTTONS.whiteboard.whiteboardLockButton = true;
|
BUTTONS.whiteboard.whiteboardLockButton = true;
|
||||||
//...
|
//...
|
||||||
|
isLobbyEnabled = lsSettings.lobby;
|
||||||
|
switchLobby.checked = isLobbyEnabled;
|
||||||
|
rc.roomAction(isLobbyEnabled ? 'lobbyOn' : 'lobbyOff');
|
||||||
|
//...
|
||||||
}
|
}
|
||||||
// main. settings...
|
// main. settings...
|
||||||
BUTTONS.settings.lockRoomButton ? show(lockRoomButton) : hide(lockRoomButton);
|
BUTTONS.settings.lockRoomButton ? show(lockRoomButton) : hide(lockRoomButton);
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم