[mirotalksfu] - add hide myself in URL param (hide=0/1)

هذا الالتزام موجود في:
Miroslav Pejic
2023-11-23 18:34:14 +01:00
الأصل a17e1eafb0
التزام e9ef3d1800
8 ملفات معدلة مع 32 إضافات و12 حذوفات

عرض الملف

@@ -89,12 +89,12 @@ let peer_uuid = getPeerUUID();
let peer_username = getPeerUsername();
let peer_password = getPeerPassword();
let isScreenAllowed = getScreen();
let isHideMeActive = getHideMeActive();
let notify = getNotify();
isPresenter = isPeerPresenter();
let peer_info = null;
let isHideMeActive = false;
let isPushToTalkActive = false;
let isSpaceDown = false;
let isPitchBarEnabled = true;
@@ -535,6 +535,18 @@ function getNotify() {
return notify;
}
function getHideMeActive() {
let qs = new URLSearchParams(window.location.search);
let hide = filterXSS(qs.get('hide'));
let queryHideMe = false;
if (hide) {
hide = hide.toLowerCase();
queryHideMe = hide === '1' || hide === 'true';
}
console.log('Direct join', { hide: queryHideMe });
return queryHideMe;
}
function isPeerPresenter() {
let qs = new URLSearchParams(window.location.search);
let presenter = filterXSS(qs.get('isPresenter'));
@@ -1160,6 +1172,7 @@ function handleButtons() {
shareRoom(true);
};
hideMeButton.onclick = (e) => {
isHideMeActive = !isHideMeActive;
rc.handleHideMe();
};
settingsButton.onclick = () => {
@@ -1352,13 +1365,11 @@ function handleButtons() {
}
setVideoButtonsDisabled(true);
if (!isEnumerateVideoDevices) initEnumerateVideoDevices();
if (isHideMeActive) rc.handleHideMe();
rc.produce(RoomClient.mediaType.video, videoSelect.value);
// rc.resumeProducer(RoomClient.mediaType.video);
};
stopVideoButton.onclick = () => {
setVideoButtonsDisabled(true);
if (isHideMeActive) rc.handleHideMe();
rc.closeProducer(RoomClient.mediaType.video);
// rc.pauseProducer(RoomClient.mediaType.video);
};
@@ -1367,11 +1378,9 @@ function handleButtons() {
if (moderator.screen_cant_share) {
return userLog('warning', 'The moderator does not allow you to share the screen', 'top-end', 6000);
}
if (isHideMeActive) rc.handleHideMe();
rc.produce(RoomClient.mediaType.screen);
};
stopScreenButton.onclick = () => {
if (isHideMeActive) rc.handleHideMe();
rc.closeProducer(RoomClient.mediaType.screen);
};
fileShareButton.onclick = () => {

عرض الملف

@@ -1013,6 +1013,10 @@ class RoomClient {
getMicrophoneVolumeIndicator(stream);
}
if (type == mediaType.video) {
this.handleHideMe();
}
producer.on('trackended', () => {
this.closeProducer(type);
});
@@ -1418,7 +1422,6 @@ class RoomClient {
// ####################################################
handleHideMe() {
isHideMeActive = !isHideMeActive;
//const myScreenWrap = this.getId(this.screenProducerId + '__video');
const myVideoWrap = this.getId(this.videoProducerId + '__video');
const myVideoWrapOff = this.getId(this.peer_id + '__videoOff');
@@ -2104,6 +2107,8 @@ class RoomClient {
console.log('[setVideoOff] Video-element-count', this.videoMediaContainer.childElementCount);
//
wbUpdate();
this.handleHideMe();
}
removeVideoOff(peer_id) {