[mirotalksfu] - fix add improvements

هذا الالتزام موجود في:
Miroslav Pejic
2025-08-07 14:31:05 +02:00
الأصل 900e7935eb
التزام f65d8654d5
9 ملفات معدلة مع 36 إضافات و42 حذوفات

عرض الملف

@@ -285,7 +285,8 @@ COPYRIGHT_TEXT=MiroTalk SFU, all rights reserved # Copyright text
SHOW_ACTIVE_ROOMS=false # Show active rooms feature (true|false) SHOW_ACTIVE_ROOMS=false # Show active rooms feature (true|false)
# Main Control Buttons # Main Control Buttons
SHOW_SHARE_QR=true # Show share room QR popup (true|false) SHOW_SHARE_ROOM_POPUP=true # Show share room popup (true|false)
SHOW_SHARE_ROOM_QR_ON_HOVER=true # Show share room QR popup on mouse hover (true|false)
SHOW_SHARE_BUTTON=true # Show share button (true|false) SHOW_SHARE_BUTTON=true # Show share button (true|false)
SHOW_HIDE_ME=true # Show hide me button (true|false) SHOW_HIDE_ME=true # Show hide me button (true|false)
SHOW_FULLSCREEN_BUTTON=true # Show fullscreen button (true|false) SHOW_FULLSCREEN_BUTTON=true # Show fullscreen button (true|false)

عرض الملف

@@ -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.9.22 * @version 1.9.23
* *
*/ */

عرض الملف

@@ -1120,7 +1120,8 @@ module.exports = {
buttons: { buttons: {
// Main control buttons visible in the UI // Main control buttons visible in the UI
main: { main: {
shareQr: process.env.SHOW_SHARE_QR !== 'false', shareRoomPopup: process.env.SHOW_SHARE_ROOM_POPUP !== 'false',
shareRoomQrOnHover: process.env.SHOW_SHARE_ROOM_QR_ON_HOVER !== 'false',
shareButton: process.env.SHOW_SHARE_BUTTON !== 'false', shareButton: process.env.SHOW_SHARE_BUTTON !== 'false',
hideMeButton: process.env.SHOW_HIDE_ME !== 'false', hideMeButton: process.env.SHOW_HIDE_ME !== 'false',
fullScreenButton: process.env.SHOW_FULLSCREEN_BUTTON !== 'false', fullScreenButton: process.env.SHOW_FULLSCREEN_BUTTON !== 'false',

عرض الملف

@@ -1,6 +1,6 @@
{ {
"name": "mirotalksfu", "name": "mirotalksfu",
"version": "1.9.22", "version": "1.9.23",
"description": "WebRTC SFU browser-based video calls", "description": "WebRTC SFU browser-based video calls",
"main": "Server.js", "main": "Server.js",
"scripts": { "scripts": {
@@ -57,11 +57,11 @@
"node": ">=18" "node": ">=18"
}, },
"dependencies": { "dependencies": {
"@aws-sdk/client-s3": "^3.859.0", "@aws-sdk/client-s3": "^3.862.0",
"@aws-sdk/lib-storage": "^3.859.0", "@aws-sdk/lib-storage": "^3.862.0",
"@mattermost/client": "10.9.0", "@mattermost/client": "10.9.0",
"@ngrok/ngrok": "1.5.2", "@ngrok/ngrok": "1.5.2",
"@sentry/node": "^10.1.0", "@sentry/node": "^10.2.0",
"async-mutex": "^0.5.0", "async-mutex": "^0.5.0",
"axios": "^1.11.0", "axios": "^1.11.0",
"chokidar": "^4.0.3", "chokidar": "^4.0.3",

عرض الملف

@@ -76,7 +76,7 @@ let BRAND = {
}, },
about: { about: {
imageUrl: '../images/mirotalk-logo.gif', imageUrl: '../images/mirotalk-logo.gif',
title: '<strong>WebRTC SFU v1.9.22</strong>', title: '<strong>WebRTC SFU v1.9.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.9.22 * @version 1.9.23
* *
*/ */
@@ -1545,7 +1545,6 @@ function joinRoom(peer_name, room_id) {
roomIsReady roomIsReady
); );
handleRoomClientEvents(); handleRoomClientEvents();
//notify ? shareRoom() : sound('joined');
} }
} }
@@ -1854,11 +1853,11 @@ function handleButtons() {
shareRoom(true); shareRoom(true);
}; };
shareButton.onmouseenter = () => { shareButton.onmouseenter = () => {
if (isMobileDevice || !BUTTONS.main.shareQr) return; if (isMobileDevice || !BUTTONS.main.shareRoomQrOnHover) return;
show(qrRoomPopupContainer); show(qrRoomPopupContainer);
}; };
shareButton.onmouseleave = () => { shareButton.onmouseleave = () => {
if (isMobileDevice || !BUTTONS.main.shareQr) return; if (isMobileDevice || !BUTTONS.main.shareRoomQrOnHover) return;
hide(qrRoomPopupContainer); hide(qrRoomPopupContainer);
}; };
hideMeButton.onclick = (e) => { hideMeButton.onclick = (e) => {
@@ -3439,7 +3438,7 @@ function handleRoomClientEvents() {
rc.on(RoomClient.EVENTS.pauseAudio, () => { rc.on(RoomClient.EVENTS.pauseAudio, () => {
console.log('Room event: Client pause audio'); console.log('Room event: Client pause audio');
hide(stopAudioButton); hide(stopAudioButton);
show(startAudioButton); BUTTONS.main.startAudioButton && show(startAudioButton);
setColor(startAudioButton, 'red'); setColor(startAudioButton, 'red');
setAudioButtonsDisabled(false); setAudioButtonsDisabled(false);
audio = false; audio = false;
@@ -3447,7 +3446,7 @@ function handleRoomClientEvents() {
rc.on(RoomClient.EVENTS.resumeAudio, () => { rc.on(RoomClient.EVENTS.resumeAudio, () => {
console.log('Room event: Client resume audio'); console.log('Room event: Client resume audio');
hide(startAudioButton); hide(startAudioButton);
show(stopAudioButton); BUTTONS.main.startAudioButton && show(stopAudioButton);
setAudioButtonsDisabled(false); setAudioButtonsDisabled(false);
audio = true; audio = true;
}); });
@@ -3472,7 +3471,7 @@ function handleRoomClientEvents() {
rc.on(RoomClient.EVENTS.pauseVideo, () => { rc.on(RoomClient.EVENTS.pauseVideo, () => {
console.log('Room event: Client pause video'); console.log('Room event: Client pause video');
hide(stopVideoButton); hide(stopVideoButton);
show(startVideoButton); BUTTONS.main.startVideoButton && show(startVideoButton);
setColor(startVideoButton, 'red'); setColor(startVideoButton, 'red');
setVideoButtonsDisabled(false); setVideoButtonsDisabled(false);
hideClassElements('videoMenuBar'); hideClassElements('videoMenuBar');
@@ -3481,7 +3480,7 @@ function handleRoomClientEvents() {
rc.on(RoomClient.EVENTS.resumeVideo, () => { rc.on(RoomClient.EVENTS.resumeVideo, () => {
console.log('Room event: Client resume video'); console.log('Room event: Client resume video');
hide(startVideoButton); hide(startVideoButton);
show(stopVideoButton); BUTTONS.main.startVideoButton && show(stopVideoButton);
setVideoButtonsDisabled(false); setVideoButtonsDisabled(false);
isVideoPrivacyActive = false; isVideoPrivacyActive = false;
hideClassElements('videoMenuBar'); hideClassElements('videoMenuBar');
@@ -5529,7 +5528,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.9.22', title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.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.9.22 * @version 1.9.23
* *
*/ */
@@ -739,8 +739,7 @@ class RoomClient {
console.log('07.2 Participants Count ---->', participantsCount); console.log('07.2 Participants Count ---->', participantsCount);
// notify && participantsCount == 1 ? shareRoom() : sound('joined'); if (BUTTONS.main.shareRoomPopup && notify && participantsCount == 1) {
if (notify && participantsCount == 1) {
shareRoom(); shareRoom();
} else { } else {
if (this.isScreenAllowed) { if (this.isScreenAllowed) {

عرض الملف

@@ -15,7 +15,8 @@ const isRulesActive = true;
*/ */
let BUTTONS = { let BUTTONS = {
main: { main: {
shareQr: true, shareRoomPopup: true,
shareRoomQrOnHover: true,
shareButton: true, // for quest, presenter default true shareButton: true, // for quest, presenter default true
hideMeButton: true, hideMeButton: true,
fullScreenButton: true, fullScreenButton: true,

عرض الملف

@@ -99,10 +99,6 @@ class MiroTalkWidget {
} }
parentNode.appendChild(widget); parentNode.appendChild(widget);
this.widgetState = 'normal';
// Initialize widget based on configured state
setTimeout(() => this.initWidgetState(this.options.widgetState), 200);
// Start status checking if enabled // Start status checking if enabled
this.initStatusChecking(); this.initStatusChecking();
@@ -113,21 +109,14 @@ class MiroTalkWidget {
} }
} }
initWidgetState(state) {
const stateActions = {
minimized: () => this.minimizeWidget(),
closed: () => this.closeWidget(),
normal: () => {}, // Already in normal state
};
const action = stateActions[state];
if (action) action();
}
initStatusChecking() { initStatusChecking() {
if (this.statusCheckInterval) {
clearInterval(this.statusCheckInterval);
this.statusCheckInterval = null;
}
if (this.options.supportWidget.checkOnlineStatus) { if (this.options.supportWidget.checkOnlineStatus) {
this.checkOnlineStatus(); this.checkOnlineStatus();
setInterval(() => this.checkOnlineStatus(), 30000); // Check every 30s this.statusCheckInterval = setInterval(() => this.checkOnlineStatus(), 30000); // Check every 30s
} }
} }
@@ -348,11 +337,9 @@ class MiroTalkWidget {
this.registerWidget(widgetId, reopenerBtn); this.registerWidget(widgetId, reopenerBtn);
reopenerBtn.innerHTML = ` reopenerBtn.innerHTML = `
<div class="reopener-content" style="display: flex; flex-direction: column; align-items: center;"> <div class="reopener-content">
<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"> ${this.getUserIcon()}
<path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4c0 .7.5 1.2 1.2 1.2h16.8c.7 0 1.2-.5 1.2-1.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/> <span>Support</span>
</svg>
<span style="font-size: 13px; font-weight: 500; margin-top: 4px;">Support</span>
</div> </div>
`; `;
@@ -575,6 +562,12 @@ class MiroTalkWidget {
</svg>`; </svg>`;
} }
getUserIcon() {
return `<svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
<path d="M12 12c2.7 0 4.8-2.1 4.8-4.8S14.7 2.4 12 2.4 7.2 4.5 7.2 7.2 9.3 12 12 12zm0 2.4c-3.2 0-9.6 1.6-9.6 4.8v2.4c0 .7.5 1.2 1.2 1.2h16.8c.7 0 1.2-.5 1.2-1.2v-2.4c0-3.2-6.4-4.8-9.6-4.8z"/>
</svg>`;
}
// ============================================================================ // ============================================================================
// PUBLIC API METHODS // PUBLIC API METHODS
// ============================================================================ // ============================================================================