[mirotalksfu] - allow video 8k and 60fps, fix focus mode, update dep

هذا الالتزام موجود في:
Miroslav Pejic
2024-08-04 12:00:33 +02:00
الأصل 4a922f009d
التزام 40c6fb5ce1
7 ملفات معدلة مع 56 إضافات و20 حذوفات

عرض الملف

@@ -2,7 +2,7 @@
<br />
<p align="center">Free WebRTC - SFU - Simple, Secure, Scalable Real-Time Video Conferences with support for up to 4k resolution. It's compatible with all major browsers and platforms</p>
<p align="center">Free WebRTC - SFU - Simple, Secure, Scalable Real-Time Video Conferences with support for up to 8k resolution and 60fps. It's compatible with all major browsers and platforms</p>
<hr />

عرض الملف

@@ -44,7 +44,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.5.36
* @version 1.5.37
*
*/

عرض الملف

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

عرض الملف

@@ -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.5.36
* @version 1.5.37
*
*/
@@ -2047,7 +2047,7 @@ async function changeCamera(deviceId) {
})
.catch((error) => {
console.error('[Error] changeCamera', error);
handleMediaError('video/audio', error);
handleMediaError('video/audio', error, '/');
});
}
@@ -2055,7 +2055,7 @@ async function changeCamera(deviceId) {
// HANDLE MEDIA ERROR
// ####################################################
function handleMediaError(mediaType, err) {
function handleMediaError(mediaType, err, redirectURL = false) {
sound('alert');
let errMessage = err;
@@ -2103,8 +2103,6 @@ function handleMediaError(mediaType, err) {
</ul>
`;
const redirectURL = ['screen', 'screenType'].includes(mediaType) || !getUserMediaError ? false : '/';
popupHtmlMessage(null, image.forbidden, 'Access denied', html, 'center', redirectURL);
throw new Error(
@@ -4332,7 +4330,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.5.36',
title: 'WebRTC SFU v1.5.37',
html: `
<br />
<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 CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - miroslav.pejic.85@gmail.com
* @version 1.5.36
* @version 1.5.37
*
*/
@@ -1626,6 +1626,30 @@ class RoomClient {
},
}; // video cam constraints ultra high bandwidth
break;
case '6k':
videoConstraints = {
audio: false,
video: {
width: { exact: 6144 },
height: { exact: 3456 },
deviceId: deviceId,
aspectRatio: 1.777,
frameRate: frameRate,
},
}; // video cam constraints Very ultra high bandwidth
break;
case '8k':
videoConstraints = {
audio: false,
video: {
width: { exact: 7680 },
height: { exact: 4320 },
deviceId: deviceId,
aspectRatio: 1.777,
frameRate: frameRate,
},
}; // video cam constraints Very ultra high bandwidth
break;
default:
break;
}
@@ -2230,7 +2254,6 @@ class RoomClient {
d = document.createElement('div');
d.className = 'Camera';
d.id = id + '__video';
d.style.display = isHideALLVideosActive ? 'none' : 'block';
elem = document.createElement('video');
elem.setAttribute('id', id);
!remoteIsScreen && elem.setAttribute('name', remotePeerId);
@@ -2272,7 +2295,7 @@ class RoomClient {
pn.className = html.pin;
ha = document.createElement('button');
ha.id = id + '__hideALL';
ha.className = html.hideALL;
ha.className = html.hideALL + ' focusMode';
sf = document.createElement('button');
sf.id = id + '___' + remotePeerId + '___sendFile';
sf.className = html.sendFile;
@@ -2359,8 +2382,17 @@ class RoomClient {
this.checkPeerInfoStatus(peer_info);
if (!remoteIsScreen && remotePrivacyOn) this.setVideoPrivacyStatus(remotePeerId, remotePrivacyOn);
if (remoteIsScreen && !isHideALLVideosActive) pn.click();
this.sound('joined');
handleAspectRatio();
if (isHideALLVideosActive) {
isHideALLVideosActive = false;
const children = this.videoMediaContainer.children;
const btnsHA = document.querySelectorAll('.focusMode');
for (let child of children) {
child.style.display = 'block';
}
btnsHA.forEach((btn) => {
btn.style.color = 'white';
});
}
console.log('[addConsumer] Video-element-count', this.videoMediaContainer.childElementCount);
if (!this.isMobileDevice) {
this.setTippy(pn.id, 'Toggle Pin', 'bottom');
@@ -2378,6 +2410,8 @@ class RoomClient {
this.setTippy(ko.id, 'Eject', 'bottom');
}
this.setPeerAudio(remotePeerId, remotePeerAudio);
handleAspectRatio();
this.sound('joined');
break;
case mediaType.audio:
elem = document.createElement('audio');
@@ -6383,7 +6417,7 @@ class RoomClient {
// HANDLE VIDEO
// ###################################################
handleHA(uid, myVideoContainerId) {
handleHA(uid, videoContainerId) {
let btnHa = this.getId(uid);
if (btnHa) {
btnHa.addEventListener('click', (e) => {
@@ -6398,15 +6432,15 @@ class RoomClient {
isHideALLVideosActive = !isHideALLVideosActive;
e.target.style.color = isHideALLVideosActive ? 'lime' : 'white';
if (isHideALLVideosActive) {
const myVideoContainer = this.getId(myVideoContainerId);
myVideoContainer.style.width = '100%';
myVideoContainer.style.height = '100%';
const videoContainer = this.getId(videoContainerId);
videoContainer.style.width = '100%';
videoContainer.style.height = '100%';
} else {
resizeVideoMedia();
}
const children = this.videoMediaContainer.children;
for (let child of children) {
if (child.id != myVideoContainerId) {
if (child.id != videoContainerId) {
child.style.display = isHideALLVideosActive ? 'none' : 'block';
}
}

عرض الملف

@@ -388,6 +388,8 @@ access to use this app.
<option value="fhd">🎥&nbsp;FULL HD</option>
<option value="2k">🎥&nbsp;2k</option>
<option value="4k">🎥&nbsp;4K</option>
<option value="6k">🎥&nbsp;6k</option>
<option value="8k">🎥&nbsp;8K</option>
</select>
<hr />
<div class="title">
@@ -397,6 +399,7 @@ access to use this app.
<br />
<select id="videoFps" class="form-select text-light bg-dark">
<option value="max">max frame-per-second</option>
<option value="60">60 - frame-per-second</option>
<option value="30">30 - frame-per-second</option>
<option value="15">15 - frame-per-second</option>
<option value="5">5 - frame-per-second</option>
@@ -410,6 +413,7 @@ access to use this app.
<br />
<select id="screenFps" class="form-select text-light bg-dark">
<option value="max">max frame-per-second</option>
<option value="60">60 - frame-per-second</option>
<option value="30">30 - frame-per-second</option>
<option value="15">15 - frame-per-second</option>
<option value="5">5 - frame-per-second</option>

عرض الملف

@@ -191,7 +191,7 @@
<h4 class="feature-title mt-24">WebCam Streaming</h4>
<p class="text-sm mb-0">
Having the webcam on, allows participants to make a deeper connection with
you. Up to 4k resolution.
you. Up to 8k resolution and 60fps.
</p>
</div>
</div>