[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 حذوفات

عرض الملف

@@ -91,8 +91,9 @@
| video | boolean | Video stream |
| screen | boolean | Screen stream |
| notify | boolean | Welcome message |
| username | string | auth username |
| password | string | auth password |
| hide | boolean | Hide myself |
| username | string | Auth username |
| password | string | Auth password |
> **Note**
>

عرض الملف

@@ -22,6 +22,7 @@ async function getJoin() {
audio: true,
video: true,
screen: true,
hide: false,
notify: true,
}),
});

عرض الملف

@@ -23,6 +23,7 @@ $data = array(
"audio" => true,
"video" => true,
"screen" => true,
"hide" => false,
"notify" => true,
);
$data_string = json_encode($data);

عرض الملف

@@ -18,6 +18,7 @@ data = {
"audio": "true",
"video": "true",
"screen": "true",
"hide": "false",
"notify": "true",
}

عرض الملف

@@ -7,5 +7,5 @@ MIROTALK_URL="https://sfu.mirotalk.com/api/v1/join"
curl $MIROTALK_URL \
--header "authorization: $API_KEY_SECRET" \
--header "Content-Type: application/json" \
--data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"true","video":"true","screen":"false","notify":"true"}' \
--data '{"room":"test","roomPassword":"false","name":"mirotalksfu","audio":"true","video":"true","screen":"false","hide":"false","notify":"true"}' \
--request POST

عرض الملف

@@ -272,9 +272,11 @@ function startServer() {
app.get('/join/', (req, res) => {
if (Object.keys(req.query).length > 0) {
log.debug('Direct Join', req.query);
// http://localhost:3010/join?room=test&roomPassword=0&name=mirotalksfu&audio=1&video=1&screen=0&notify=1
// http://localhost:3010/join?room=test&roomPassword=0&name=mirotalksfu&audio=1&video=1&screen=0&notify=0&username=username&password=password
const { room, roomPassword, name, audio, video, screen, notify, username, password, isPresenter } =
// http://localhost:3010/join?room=test&roomPassword=0&name=mirotalksfu&audio=1&video=1&screen=0&hide=0&notify=1
// http://localhost:3010/join?room=test&roomPassword=0&name=mirotalksfu&audio=1&video=1&screen=0&hide=0&notify=0&username=username&password=password
const { room, roomPassword, name, audio, video, screen, hide, notify, username, password, isPresenter } =
checkXSS(req.query);
const isPeerValid = isAuthPeer(username, password);

عرض الملف

@@ -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) {