[mirotalksfu] - fix join room (presenter)

هذا الالتزام موجود في:
Miroslav Pejic
2025-04-20 00:54:43 +02:00
الأصل 377f2bcda2
التزام c6e38df6e3
5 ملفات معدلة مع 24 إضافات و15 حذوفات

عرض الملف

@@ -64,7 +64,7 @@ dev dependencies: {
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @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 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.22 * @version 1.8.23
* *
*/ */
@@ -1538,10 +1538,19 @@ function startServer() {
const room = getRoom(socket); const room = getRoom(socket);
const { peer_name, peer_id, peer_uuid, peer_token, os_name, os_version, browser_name, browser_version } = const {
data.peer_info; peer_name,
peer_id,
peer_uuid,
peer_token,
peer_presenter,
os_name,
os_version,
browser_name,
browser_version,
} = data.peer_info;
let is_presenter = true; let is_presenter = peer_presenter;
// User Auth required or detect token, we check if peer valid // User Auth required or detect token, we check if peer valid
if (hostCfg.user_auth || peer_token) { if (hostCfg.user_auth || peer_token) {
@@ -1565,7 +1574,7 @@ function startServer() {
return cb('unauthorized'); return cb('unauthorized');
} }
const is_presenter = is_presenter =
presenter === '1' || presenter === '1' ||
presenter === 'true' || presenter === 'true' ||
(hostCfg?.presenters?.join_first && room?.getPeersCount() === 0); (hostCfg?.presenters?.join_first && room?.getPeersCount() === 0);
@@ -1656,14 +1665,14 @@ function startServer() {
}); });
} }
peer.updatePeerInfo({ type: 'presenter', status: isPresenter }); log.info('[Join] - Is Peer presenter', {
log.info('[Join] - Is presenter', {
roomId: socket.room_id, roomId: socket.room_id,
peer_name: peer_name, peer_name: peer_name,
peer_presenter: isPresenter, peer_presenter: isPresenter,
}); });
peer.updatePeerInfo({ type: 'presenter', status: isPresenter });
if (room.isLocked() && !isPresenter) { if (room.isLocked() && !isPresenter) {
log.debug('The user was rejected because the room is locked, and they are not a presenter'); log.debug('The user was rejected because the room is locked, and they are not a presenter');
return cb('isLocked'); return cb('isLocked');
@@ -3285,7 +3294,7 @@ function startServer() {
// Fallback condition: list check // Fallback condition: list check
hostCfg?.presenters?.list?.includes(peer_name); hostCfg?.presenters?.list?.includes(peer_name);
log.debug('isPeerPresenter', { log.debug('isPeerPresenter Check', {
room_id: room_id, room_id: room_id,
peer_id: peer_id, peer_id: peer_id,
peer_name: peer_name, peer_name: peer_name,
@@ -3295,7 +3304,7 @@ function startServer() {
return isPresenter; return isPresenter;
} catch (err) { } catch (err) {
log.error('isPeerPresenter', err); log.error('isPeerPresenter Check error', err);
return false; return false;
} }
} }

عرض الملف

@@ -1,6 +1,6 @@
{ {
"name": "mirotalksfu", "name": "mirotalksfu",
"version": "1.8.22", "version": "1.8.23",
"description": "WebRTC SFU browser-based video calls", "description": "WebRTC SFU browser-based video calls",
"main": "Server.js", "main": "Server.js",
"scripts": { "scripts": {

عرض الملف

@@ -64,7 +64,7 @@ let BRAND = {
}, },
about: { about: {
imageUrl: '../images/mirotalk-logo.gif', imageUrl: '../images/mirotalk-logo.gif',
title: '<strong>WebRTC SFU v1.8.22</strong>', title: '<strong>WebRTC SFU v1.8.23</strong>',
html: ` html: `
<button <button
id="support-button" id="support-button"

عرض الملف

@@ -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 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 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.22 * @version 1.8.23
* *
*/ */
@@ -5351,7 +5351,7 @@ function showAbout() {
position: 'center', position: 'center',
imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about, imageUrl: BRAND.about?.imageUrl && BRAND.about.imageUrl.trim() !== '' ? BRAND.about.imageUrl : image.about,
customClass: { image: 'img-about' }, customClass: { image: 'img-about' },
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.8.22', title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.8.23',
html: ` html: `
<br /> <br />
<div id="about"> <div id="about">

عرض الملف

@@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @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 * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com * @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.8.22 * @version 1.8.23
* *
*/ */