[mirotalksfu] - add join_first in presenters config
هذا الالتزام موجود في:
@@ -40,7 +40,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.2.9
|
||||
* @version 1.3.0
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -1001,7 +1001,12 @@ function startServer() {
|
||||
is_presenter: true,
|
||||
};
|
||||
// first we check if the username match the presenters username
|
||||
if (config.presenters && config.presenters.includes(peer_name)) {
|
||||
if (
|
||||
config.presenters &&
|
||||
!config.presenters.join_first &&
|
||||
config.presenters.list &&
|
||||
config.presenters.list.includes(peer_name)
|
||||
) {
|
||||
presenters[socket.room_id][socket.id] = presenter;
|
||||
} else {
|
||||
// if not match the presenters username, the first one join room is the presenter
|
||||
@@ -1413,7 +1418,11 @@ function startServer() {
|
||||
|
||||
async function isPeerPresenter(room_id, peer_id, peer_name, peer_uuid) {
|
||||
try {
|
||||
if (!presenters[room_id] || !presenters[room_id][peer_id]) {
|
||||
if (
|
||||
config.presenters &&
|
||||
config.presenters.join_first &&
|
||||
(!presenters[room_id] || !presenters[room_id][peer_id])
|
||||
) {
|
||||
// Presenter not in the presenters config list, disconnected, or peer_id changed...
|
||||
for (const [existingPeerID, presenter] of Object.entries(presenters[room_id] || {})) {
|
||||
if (presenter.peer_name === peer_name) {
|
||||
@@ -1429,11 +1438,13 @@ function startServer() {
|
||||
}
|
||||
|
||||
const isPresenter =
|
||||
(typeof presenters[room_id] === 'object' &&
|
||||
(config.presenters &&
|
||||
config.presenters.join_first &&
|
||||
typeof presenters[room_id] === 'object' &&
|
||||
Object.keys(presenters[room_id][peer_id]).length > 1 &&
|
||||
presenters[room_id][peer_id]['peer_name'] === peer_name &&
|
||||
presenters[room_id][peer_id]['peer_uuid'] === peer_uuid) ||
|
||||
(config.presenters && config.presenters.includes(peer_name));
|
||||
(config.presenters && config.presenters.list && config.presenters.list.includes(peer_name));
|
||||
|
||||
log.debug('isPeerPresenter', {
|
||||
room_id: room_id,
|
||||
|
||||
@@ -56,14 +56,17 @@ module.exports = {
|
||||
//...
|
||||
],
|
||||
},
|
||||
presenters: [
|
||||
/*
|
||||
By default, the presenter is identified as the first participant to join the room, distinguished by their username and UUID.
|
||||
Additional layers can be added to specify valid presenters and co-presenters by setting designated usernames.
|
||||
*/
|
||||
'Miroslav Pejic',
|
||||
'MiroTalk SFU',
|
||||
],
|
||||
presenters: {
|
||||
list: [
|
||||
/*
|
||||
By default, the presenter is identified as the first participant to join the room, distinguished by their username and UUID.
|
||||
Additional layers can be added to specify valid presenters and co-presenters by setting designated usernames.
|
||||
*/
|
||||
'Miroslav Pejic',
|
||||
'MiroTalk SFU',
|
||||
],
|
||||
join_first: true, // Set to true for traditional behavior, false to prioritize presenters
|
||||
},
|
||||
console: {
|
||||
debug: true,
|
||||
colors: true,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mirotalksfu",
|
||||
"version": "1.2.9",
|
||||
"version": "1.3.0",
|
||||
"description": "WebRTC SFU browser-based video calls",
|
||||
"main": "Server.js",
|
||||
"scripts": {
|
||||
@@ -34,8 +34,8 @@
|
||||
"author": "Miroslav Pejic",
|
||||
"license": "AGPL-3.0",
|
||||
"dependencies": {
|
||||
"@sentry/integrations": "7.83.0",
|
||||
"@sentry/node": "7.83.0",
|
||||
"@sentry/integrations": "7.84.0",
|
||||
"@sentry/node": "7.84.0",
|
||||
"axios": "^1.6.2",
|
||||
"body-parser": "1.20.2",
|
||||
"colors": "1.4.0",
|
||||
|
||||
@@ -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.2.9
|
||||
* @version 1.3.0
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
@@ -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.2.9
|
||||
* @version 1.3.0
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم