[mirotalksfu] - fix for firefox, update dep
هذا الالتزام موجود في:
22
package-lock.json
مولّد
22
package-lock.json
مولّد
@@ -1,16 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.06",
|
"version": "1.9.07",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.06",
|
"version": "1.9.07",
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.848.0",
|
"@aws-sdk/client-s3": "^3.850.0",
|
||||||
"@aws-sdk/lib-storage": "^3.848.0",
|
"@aws-sdk/lib-storage": "^3.850.0",
|
||||||
"@mattermost/client": "10.8.0",
|
"@mattermost/client": "10.8.0",
|
||||||
"@ngrok/ngrok": "1.5.1",
|
"@ngrok/ngrok": "1.5.1",
|
||||||
"@sentry/node": "^9.40.0",
|
"@sentry/node": "^9.40.0",
|
||||||
@@ -297,9 +297,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aws-sdk/client-s3": {
|
"node_modules/@aws-sdk/client-s3": {
|
||||||
"version": "3.848.0",
|
"version": "3.850.0",
|
||||||
"resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.848.0.tgz",
|
"resolved": "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.850.0.tgz",
|
||||||
"integrity": "sha512-6uT+THQfsB92eAH0p5zvpGiSCtO2ZhGwmuw6HWEngui53YIWz7W/GCnN0G7nrKpgD5DPrMaBwqZvKuoAh9NHAQ==",
|
"integrity": "sha512-tX5bUfqiLOh6jtAlaiAuOUKFYh8KDG9k9zFLUdgGplC5TP47AYTreUEg+deCTHo4DD3YCvrLuyZ8tIDgKu7neQ==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-crypto/sha1-browser": "5.2.0",
|
"@aws-crypto/sha1-browser": "5.2.0",
|
||||||
@@ -591,9 +591,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aws-sdk/lib-storage": {
|
"node_modules/@aws-sdk/lib-storage": {
|
||||||
"version": "3.848.0",
|
"version": "3.850.0",
|
||||||
"resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.848.0.tgz",
|
"resolved": "https://registry.npmjs.org/@aws-sdk/lib-storage/-/lib-storage-3.850.0.tgz",
|
||||||
"integrity": "sha512-Q23bI829ZQBHP6Iab9YsfCrZKvek2uMIVYEQjPa0Ekib5bmqURFCXhNtrP++TOCaZNr5DmSPAqAs8EGHWTOZiw==",
|
"integrity": "sha512-DKG8mKeUMLRboyqwhKiV9QOiKXN00OYLnGsT21mhlaF1Uc7OZ6Vm+Olw4YrbYSBuDup0rMWtVaWudJ49I+ZCHA==",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@smithy/abort-controller": "^4.0.4",
|
"@smithy/abort-controller": "^4.0.4",
|
||||||
@@ -608,7 +608,7 @@
|
|||||||
"node": ">=18.0.0"
|
"node": ">=18.0.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.848.0"
|
"@aws-sdk/client-s3": "^3.850.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@aws-sdk/lib-storage/node_modules/buffer": {
|
"node_modules/@aws-sdk/lib-storage/node_modules/buffer": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "mirotalksfu",
|
"name": "mirotalksfu",
|
||||||
"version": "1.9.06",
|
"version": "1.9.07",
|
||||||
"description": "WebRTC SFU browser-based video calls",
|
"description": "WebRTC SFU browser-based video calls",
|
||||||
"main": "Server.js",
|
"main": "Server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -57,8 +57,8 @@
|
|||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@aws-sdk/client-s3": "^3.848.0",
|
"@aws-sdk/client-s3": "^3.850.0",
|
||||||
"@aws-sdk/lib-storage": "^3.848.0",
|
"@aws-sdk/lib-storage": "^3.850.0",
|
||||||
"@mattermost/client": "10.8.0",
|
"@mattermost/client": "10.8.0",
|
||||||
"@ngrok/ngrok": "1.5.1",
|
"@ngrok/ngrok": "1.5.1",
|
||||||
"@sentry/node": "^9.40.0",
|
"@sentry/node": "^9.40.0",
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ let BRAND = {
|
|||||||
},
|
},
|
||||||
about: {
|
about: {
|
||||||
imageUrl: '../images/mirotalk-logo.gif',
|
imageUrl: '../images/mirotalk-logo.gif',
|
||||||
title: '<strong>WebRTC SFU v1.9.06</strong>',
|
title: '<strong>WebRTC SFU v1.9.07</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.06
|
* @version 1.9.07
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -29,6 +29,7 @@ const isMobileDevice = deviceType === 'mobile';
|
|||||||
const isTabletDevice = deviceType === 'tablet';
|
const isTabletDevice = deviceType === 'tablet';
|
||||||
const isIPadDevice = parserResult.device.model?.toLowerCase() === 'ipad';
|
const isIPadDevice = parserResult.device.model?.toLowerCase() === 'ipad';
|
||||||
const isDesktopDevice = deviceType === 'desktop';
|
const isDesktopDevice = deviceType === 'desktop';
|
||||||
|
const isFirefox = parserResult.browser.name?.toLowerCase() === 'firefox';
|
||||||
const thisInfo = getInfo();
|
const thisInfo = getInfo();
|
||||||
|
|
||||||
const isEmbedded = window.self !== window.top;
|
const isEmbedded = window.self !== window.top;
|
||||||
@@ -2465,6 +2466,9 @@ function handleMediaError(mediaType, err, redirectURL = false) {
|
|||||||
case 'OverconstrainedError':
|
case 'OverconstrainedError':
|
||||||
case 'ConstraintNotSatisfiedError':
|
case 'ConstraintNotSatisfiedError':
|
||||||
errMessage = 'Constraints cannot be satisfied by available devices';
|
errMessage = 'Constraints cannot be satisfied by available devices';
|
||||||
|
if (videoQuality.selectedIndex != 0) {
|
||||||
|
videoQuality.selectedIndex = rc.videoQualitySelectedIndex;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'NotAllowedError':
|
case 'NotAllowedError':
|
||||||
case 'PermissionDeniedError':
|
case 'PermissionDeniedError':
|
||||||
@@ -5465,7 +5469,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.06',
|
title: BRAND.about?.title && BRAND.about.title.trim() !== '' ? BRAND.about.title : 'WebRTC SFU v1.9.07',
|
||||||
html: `
|
html: `
|
||||||
<br />
|
<br />
|
||||||
<div id="about">
|
<div id="about">
|
||||||
|
|||||||
@@ -1911,18 +1911,7 @@ class RoomClient {
|
|||||||
return producer;
|
return producer;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Produce error:', err);
|
console.error('Produce error:', err);
|
||||||
|
|
||||||
handleMediaError(type, err);
|
handleMediaError(type, err);
|
||||||
|
|
||||||
if (!audio && !screen && videoQuality.selectedIndex != 0) {
|
|
||||||
videoQuality.selectedIndex = this.videoQualitySelectedIndex;
|
|
||||||
this.sound('alert');
|
|
||||||
this.userLog(
|
|
||||||
'error',
|
|
||||||
`Your device doesn't support the selected video quality (${videoQuality.value}), please select the another one.`,
|
|
||||||
'top-end'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2216,53 +2205,69 @@ class RoomClient {
|
|||||||
const defaultFrameRate = { ideal: 30 };
|
const defaultFrameRate = { ideal: 30 };
|
||||||
const selectedValue = this.getSelectedIndexValue(videoFps);
|
const selectedValue = this.getSelectedIndexValue(videoFps);
|
||||||
const customFrameRate = parseInt(selectedValue, 10);
|
const customFrameRate = parseInt(selectedValue, 10);
|
||||||
const frameRate = selectedValue === 'max' ? defaultFrameRate : { ideal: customFrameRate };
|
const frameRate = selectedValue === 'max' ? defaultFrameRate : customFrameRate;
|
||||||
|
|
||||||
// Base constraints structure with dynamic values for resolution and frame rate
|
// Helper to create constraints
|
||||||
const videoBaseConstraints = (width, height, exact = false) => ({
|
function createConstraints(width, height, frameRate, isIdeal = false) {
|
||||||
audio: false,
|
const constraints = {
|
||||||
video: {
|
width: isIdeal ? { ideal: width } : { exact: width },
|
||||||
width: exact ? { exact: width } : { ideal: width },
|
height: isIdeal ? { ideal: height } : { exact: height },
|
||||||
height: exact ? { exact: height } : { ideal: height },
|
};
|
||||||
deviceId: deviceId,
|
// Only add frameRate for non-Firefox browsers
|
||||||
aspectRatio: 1.777, // 16:9 aspect ratio
|
if (!isFirefox) {
|
||||||
frameRate: frameRate,
|
constraints.frameRate = isIdeal ? { ideal: frameRate } : frameRate;
|
||||||
},
|
}
|
||||||
});
|
return constraints;
|
||||||
|
}
|
||||||
|
|
||||||
const videoResolutionMap = {
|
let constraints = {};
|
||||||
qvga: { width: 320, height: 240, exact: true },
|
|
||||||
vga: { width: 640, height: 480, exact: true },
|
|
||||||
hd: { width: 1280, height: 720, exact: true },
|
|
||||||
fhd: { width: 1920, height: 1080, exact: true },
|
|
||||||
'2k': { width: 2560, height: 1440, exact: true },
|
|
||||||
'4k': { width: 3840, height: 2160, exact: true },
|
|
||||||
'6k': { width: 6144, height: 3456, exact: true },
|
|
||||||
'8k': { width: 7680, height: 4320, exact: true },
|
|
||||||
};
|
|
||||||
|
|
||||||
let videoConstraints;
|
|
||||||
|
|
||||||
switch (videoQuality.value) {
|
switch (videoQuality.value) {
|
||||||
case 'default':
|
case 'default':
|
||||||
// Default ideal HD resolution
|
constraints = createConstraints(1280, 720, 30, true);
|
||||||
videoConstraints = videoBaseConstraints(1280, 720);
|
|
||||||
videoFps.selectedIndex = 0;
|
videoFps.selectedIndex = 0;
|
||||||
videoFps.disabled = true;
|
videoFps.disabled = true;
|
||||||
break;
|
break;
|
||||||
|
case 'qvga':
|
||||||
|
constraints = createConstraints(320, 240, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case 'vga':
|
||||||
|
constraints = createConstraints(640, 480, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case 'hd':
|
||||||
|
constraints = createConstraints(1280, 720, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case 'fhd':
|
||||||
|
constraints = createConstraints(1920, 1080, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case '2k':
|
||||||
|
constraints = createConstraints(2560, 1440, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case '4k':
|
||||||
|
constraints = createConstraints(3840, 2160, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case '6k':
|
||||||
|
constraints = createConstraints(6144, 3456, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
|
case '8k':
|
||||||
|
constraints = createConstraints(7680, 4320, frameRate, isFirefox);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
// Ideal Full HD if no match found in the video resolution map
|
// fallback to HD
|
||||||
const { width, height, exact } = videoResolutionMap[videoQuality.value] || {
|
constraints = createConstraints(1280, 720, frameRate, isFirefox);
|
||||||
width: 1920,
|
|
||||||
height: 1080,
|
|
||||||
};
|
|
||||||
videoConstraints = videoBaseConstraints(width, height, exact);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.videoQualitySelectedIndex = videoQuality.selectedIndex;
|
// Add deviceId if provided
|
||||||
|
if (deviceId) {
|
||||||
|
constraints.deviceId = deviceId;
|
||||||
|
}
|
||||||
|
|
||||||
return videoConstraints;
|
// Compose final constraints object
|
||||||
|
return {
|
||||||
|
audio: false,
|
||||||
|
video: constraints,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
getScreenConstraints() {
|
getScreenConstraints() {
|
||||||
@@ -2272,15 +2277,20 @@ class RoomClient {
|
|||||||
const frameRate = selectedValue === 'max' ? defaultFrameRate : { ideal: customFrameRate };
|
const frameRate = selectedValue === 'max' ? defaultFrameRate : { ideal: customFrameRate };
|
||||||
|
|
||||||
// Base constraints structure with dynamic values for resolution and frame rate
|
// Base constraints structure with dynamic values for resolution and frame rate
|
||||||
const screenBaseConstraints = (width, height) => ({
|
const screenBaseConstraints = (width, height) => {
|
||||||
audio: true,
|
const videoConstraints = {
|
||||||
video: {
|
|
||||||
width: { ideal: width },
|
width: { ideal: width },
|
||||||
height: { ideal: height },
|
height: { ideal: height },
|
||||||
aspectRatio: 1.777, // 16:9 aspect ratio
|
aspectRatio: 1.777, // 16:9 aspect ratio
|
||||||
frameRate: frameRate,
|
};
|
||||||
},
|
if (!isFirefox) {
|
||||||
});
|
videoConstraints.frameRate = frameRate;
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
audio: true,
|
||||||
|
video: videoConstraints,
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
const screenResolutionMap = {
|
const screenResolutionMap = {
|
||||||
hd: { width: 1280, height: 720 },
|
hd: { width: 1280, height: 720 },
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم