[mirotalksfu] - keep lobby, pitch_bar, sounds config on join room
هذا الالتزام موجود في:
@@ -16,6 +16,9 @@ class LocalStorage {
|
||||
};
|
||||
|
||||
this.SFU_SETTINGS = {
|
||||
lobby: false,
|
||||
pitch_bar: true,
|
||||
sounds: true,
|
||||
video_obj_fit: 2, // cover
|
||||
video_controls: 0, // off
|
||||
theme: 0, // dark
|
||||
|
||||
@@ -1344,18 +1344,24 @@ function handleSelects() {
|
||||
lS.setLocalStorageDevices(lS.MEDIA_TYPE.speaker, initSpeakerSelect.selectedIndex, initSpeakerSelect.value);
|
||||
};
|
||||
// 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) => {
|
||||
isLobbyEnabled = e.currentTarget.checked;
|
||||
rc.roomAction(isLobbyEnabled ? 'lobbyOn' : 'lobbyOff');
|
||||
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
|
||||
BtnAspectRatio.onchange = () => {
|
||||
@@ -1464,6 +1470,10 @@ function handleInputs() {
|
||||
// ####################################################
|
||||
|
||||
function loadSettingsFromLocalStorage() {
|
||||
isPitchBarEnabled = lsSettings.pitch_bar;
|
||||
isSoundEnabled = lsSettings.sounds;
|
||||
switchPitchBar.checked = isPitchBarEnabled;
|
||||
switchSounds.checked = isSoundEnabled;
|
||||
BtnVideoObjectFit.selectedIndex = lsSettings.video_obj_fit;
|
||||
BtnVideoControls.selectedIndex = lsSettings.video_controls;
|
||||
BtnsBarPosition.selectedIndex = lsSettings.buttons_bar;
|
||||
|
||||
@@ -2034,8 +2034,8 @@ class RoomClient {
|
||||
exit(offline = false) {
|
||||
let clean = function () {
|
||||
this._isConnected = false;
|
||||
this.consumerTransport.close();
|
||||
this.producerTransport.close();
|
||||
if (this.consumerTransport) this.consumerTransport.close();
|
||||
if (this.producerTransport) this.producerTransport.close();
|
||||
this.socket.off('disconnect');
|
||||
this.socket.off('newProducers');
|
||||
this.socket.off('consumerClosed');
|
||||
|
||||
@@ -101,6 +101,10 @@ function handleRules(isPresenter) {
|
||||
BUTTONS.consumerVideo.muteVideoButton = true;
|
||||
BUTTONS.whiteboard.whiteboardLockButton = true;
|
||||
//...
|
||||
isLobbyEnabled = lsSettings.lobby;
|
||||
switchLobby.checked = isLobbyEnabled;
|
||||
rc.roomAction(isLobbyEnabled ? 'lobbyOn' : 'lobbyOff');
|
||||
//...
|
||||
}
|
||||
// main. settings...
|
||||
BUTTONS.settings.lockRoomButton ? show(lockRoomButton) : hide(lockRoomButton);
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم