[mirotalksfu] - add disconnect all upon leaving room, update dep

هذا الالتزام موجود في:
Miroslav Pejic
2024-02-19 20:28:55 +01:00
الأصل 90f23ea468
التزام 07dae09c54
7 ملفات معدلة مع 60 إضافات و8 حذوفات

عرض الملف

@@ -41,7 +41,7 @@ dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.70
* @version 1.3.71
*
*/
@@ -813,7 +813,7 @@ function startServer() {
callback({ peerCounts: peerCounts });
});
socket.on('cmd', (dataObject) => {
socket.on('cmd', async (dataObject) => {
if (!roomList.has(socket.room_id)) return;
const data = checkXSS(dataObject);
@@ -826,6 +826,11 @@ function startServer() {
case 'privacy':
room.getPeers().get(socket.id).updatePeerInfo({ type: data.type, status: data.active });
break;
case 'ejectAll':
const { peer_name, peer_uuid } = data;
const isPresenter = await isPeerPresenter(socket.room_id, socket.id, peer_name, peer_uuid);
if (!isPresenter) return;
break;
default:
break;
//...

عرض الملف

@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.3.70",
"version": "1.3.71",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
@@ -50,7 +50,7 @@
"httpolyglot": "0.1.2",
"jsonwebtoken": "^9.0.2",
"mediasoup": "3.13.19",
"mediasoup-client": "3.7.2",
"mediasoup-client": "3.7.3",
"ngrok": "^5.0.0-beta.2",
"openai": "^4.28.0",
"qs": "6.11.2",

عرض الملف

@@ -28,6 +28,7 @@ class LocalStorage {
moderator_screen_cant_share: false, // Everyone can't share screen
moderator_chat_cant_privately: false, // Everyone can't chat privately, only Public chat allowed
moderator_chat_cant_chatgpt: false, // Everyone can't chat with ChatGPT
moderator_disconnect_all_on_leave: false, // Disconnect all participants on leave room
mic_auto_gain_control: false,
mic_echo_cancellations: true,
mic_noise_suppression: true,

عرض الملف

@@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.70
* @version 1.3.71
*
*/
@@ -2122,6 +2122,13 @@ function handleSelects() {
lS.setSettings(localStorageSettings);
e.target.blur();
};
switchDisconnectAllOnLeave.onchange = (e) => {
const disconnectAll = e.currentTarget.checked;
rc.roomMessage('disconnect_all_on_leave', disconnectAll);
localStorageSettings.moderator_disconnect_all_on_leave = disconnectAll;
lS.setSettings(localStorageSettings);
e.target.blur();
};
}
// ####################################################

عرض الملف

@@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.3.70
* @version 1.3.71
*
*/
@@ -2380,9 +2380,26 @@ class RoomClient {
exitRoom() {
//...
if (isPresenter && switchDisconnectAllOnLeave.checked) {
this.ejectAllOnLeave();
}
this.exit();
}
// ####################################################
// EJECT ALL ON LEAVE ROOM
// ####################################################
ejectAllOnLeave() {
const cmd = {
type: 'ejectAll',
peer_name: this.peer_name,
peer_uuid: this.peer_uuid,
broadcast: true,
};
this.emitCmd(cmd);
}
// ####################################################
// HELPERS
// ####################################################
@@ -5134,6 +5151,9 @@ class RoomClient {
'top-end',
);
break;
case 'disconnect_all_on_leave':
this.userLog('info', `${icons.moderator} Moderator: disconnect all on leave room ${status}`, 'top-end');
break;
case 'recPrioritizeH264':
this.userLog('info', `${icons.codecs} Recording prioritize h.264 ${status}`, 'top-end');
break;
@@ -5637,6 +5657,9 @@ class RoomClient {
this.sound('alert');
this.userLog('warning', cmd.data, 'top-end', 5000);
break;
case 'ejectAll':
this.exit();
break;
default:
break;
//...

عرض الملف

@@ -154,6 +154,7 @@ function handleRules(isPresenter) {
switchEveryoneCantShareScreen.checked = localStorageSettings.moderator_screen_cant_share;
switchEveryoneCantChatPrivately.checked = localStorageSettings.moderator_chat_cant_privately;
switchEveryoneCantChatChatGPT.checked = localStorageSettings.moderator_chat_cant_chatgpt;
switchDisconnectAllOnLeave.checked = localStorageSettings.moderator_disconnect_all_on_leave;
// Update moderator settings...
const moderatorData = {

عرض الملف

@@ -620,8 +620,6 @@ access to use this app.
</div>
<div id="tabModerator" class="tabcontent">
<h3 class="mod-title">Moderator options</h3>
<hr style="border: 1px solid grey" />
<table class="settingsTable">
<tr id="everyoneMuteBtn">
<td style="width: auto">
@@ -749,6 +747,23 @@ access to use this app.
</div>
</td>
</tr>
<tr id="disconnectAllOnLeave">
<td style="width: auto">
<div class="title">
<i class="fas fa-users-slash red"></i>
<p>Disconnect all upon leaving room</p>
</div>
</td>
<td>
<div class="form-check form-switch form-switch-md">
<input
id="switchDisconnectAllOnLeave"
class="form-check-input"
type="checkbox"
/>
</div>
</td>
</tr>
</table>
</div>