[mirotalksfu] - improvements

هذا الالتزام موجود في:
Miroslav Pejic
2024-07-01 15:28:24 +02:00
الأصل 6437b81e98
التزام 47e2c4a5fe
8 ملفات معدلة مع 36 إضافات و11 حذوفات

عرض الملف

@@ -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.4.73
* @version 1.4.74
*
*/
@@ -4032,7 +4032,7 @@ function showAbout() {
imageUrl: image.about,
customClass: { image: 'img-about' },
position: 'center',
title: 'WebRTC SFU v1.4.73',
title: 'WebRTC SFU v1.4.74',
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.4.73
* @version 1.4.74
*
*/

عرض الملف

@@ -45,12 +45,23 @@ function showError(message) {
showPopup(message, 'error');
}
function isChromeBased() {
const parser = new UAParser();
const browser = parser.getBrowser();
const browserName = browser.name.toLowerCase();
// List of known Chrome-based browser names
const chromeBasedBrowsers = ['chrome', 'chromium', 'opera', 'edge', 'brave', 'samsung internet'];
return chromeBasedBrowsers.includes(browserName);
}
function checkBrowserSupport() {
const userAgent = navigator.userAgent.toLowerCase();
console.log('UserAgent', userAgent);
if (userAgent.includes('chrome') && !userAgent.includes('edge') && !userAgent.includes('opr')) {
if (isChromeBased()) {
console.log('Browser is Chrome-based. Proceed with functionality.');
} else {
toggleButtons(true);
@@ -85,7 +96,7 @@ window.onload = function () {
async function startCapture(constraints) {
try {
const stream = await navigator.mediaDevices.getUserMedia(constraints);
videoElement.srcObject = stream;
attachMediaStream(stream);
return stream;
} catch (err) {
console.error('Error accessing media devices.', err);
@@ -96,7 +107,7 @@ async function startCapture(constraints) {
async function startScreenCapture(constraints) {
try {
const stream = await navigator.mediaDevices.getDisplayMedia(constraints);
videoElement.srcObject = stream;
attachMediaStream(stream);
return stream;
} catch (err) {
console.error('Error accessing screen media.', err);
@@ -104,6 +115,15 @@ async function startScreenCapture(constraints) {
}
}
function attachMediaStream(stream) {
videoElement.srcObject = stream;
videoElement.playsInline = true;
videoElement.autoplay = true;
videoElement.muted = true;
videoElement.volume = 0;
videoElement.controls = false;
}
async function initRTMP(stream) {
const apiSecret = apiSecretInput.value;
try {

عرض الملف

@@ -49,8 +49,11 @@
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<!-- JS scripts -->
<!-- UAParser -->
<script defer src="https://cdn.jsdelivr.net/npm/ua-parser-js@latest/dist/ua-parser.min.js"></script>
<!-- JS scripts -->
<script defer src="../js/Brand.js"></script>
<script defer src="../js/RtmpStreamer.js"></script>
</head>
@@ -82,7 +85,7 @@
<button id="copy" title="Click to copy the RTMP URL">Copy</button>
</div>
<video id="video" width="640" height="480" autoplay></video>
<video id="video" width="640" height="480"></video>
<div class="button-group">
<button id="startCamera" title="Click to start camera streaming">Start Camera Streaming</button>