[mirotalksfu] - #194 Rename class, fix typo

هذا الالتزام موجود في:
Miroslav Pejic
2025-02-16 09:04:54 +01:00
الأصل c999eff718
التزام a7286b8fd1
7 ملفات معدلة مع 15 إضافات و15 حذوفات

عرض الملف

@@ -64,7 +64,7 @@ let BRAND = {
},
about: {
imageUrl: '../images/mirotalk-logo.gif',
title: '<strong>WebRTC SFU v1.7.43</strong>',
title: '<strong>WebRTC SFU v1.7.44</strong>',
html: `
<button
id="support-button"

عرض الملف

@@ -5104,14 +5104,14 @@ function showImageSelector() {
async function applyVirtualBackground(videoElement, stream, blurLevel, backgroundImage) {
const videoTrack = stream.getVideoTracks()[0];
const processor = new WebRTCStreamProcessor();
const virtualBackground = new VirtualBackground();
if (blurLevel) {
videoElement.srcObject = await processor.applyBlurToWebRTCStream(videoTrack, blurLevel);
videoElement.srcObject = await virtualBackground.applyBlurToWebRTCStream(videoTrack, blurLevel);
virtualBackgroundBlurLevel = blurLevel;
virtualBackgroundSelectedImage = null;
} else if (backgroundImage) {
videoElement.srcObject = await processor.applyVirtualBackgroundToWebRTCStream(videoTrack, backgroundImage);
videoElement.srcObject = await virtualBackground.applyVirtualBackgroundToWebRTCStream(videoTrack, backgroundImage);
virtualBackgroundSelectedImage = backgroundImage;
virtualBackgroundBlurLevel = null;
} else {

عرض الملف

@@ -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.7.43
* @version 1.7.44
*
*/
@@ -1489,16 +1489,16 @@ class RoomClient {
// Handle Virtual Background and Blur using MediaPipe
if (video && MediaStreamTrackProcessorSupported) {
const videoTrack = stream.getVideoTracks()[0];
const processor = new WebRTCStreamProcessor();
const virtualBackground = new VirtualBackground();
if (virtualBackgroundBlurLevel) {
// Apply blur before sending it to WebRTC
stream = await processor.applyBlurToWebRTCStream(videoTrack, virtualBackgroundBlurLevel);
// Apply blur before sending it to WebRTC stream
stream = await virtualBackground.applyBlurToWebRTCStream(videoTrack, virtualBackgroundBlurLevel);
}
if (virtualBackgroundSelectedImage) {
// Apply background image before sending it to WebRTC
stream = await processor.applyVirtualBackgroundToWebRTCStream(
// Apply virtual background to WebRTC stream
stream = await virtualBackground.applyVirtualBackgroundToWebRTCStream(
videoTrack,
virtualBackgroundSelectedImage,
);
@@ -1670,7 +1670,7 @@ class RoomClient {
}
// ####################################################
// HANDLE INIT VIRTUAL BACKGROUND AND BLUR
// HANDLE VIRTUAL BACKGROUND AND BLUR
// ####################################################
showVideoImageSelector() {

عرض الملف

@@ -1,6 +1,6 @@
'use strict';
class WebRTCStreamProcessor {
class VirtualBackground {
constructor() {
this.segmentation = null;
this.initialized = false;

عرض الملف

@@ -118,7 +118,7 @@
<script defer src="../js/SpeechRec.js"></script>
<script defer src="../js/Transcription.js"></script>
<script defer src="../js/VideoGrid.js"></script>
<script defer src="../js/WebRTCStreamProcessor.js"></script>
<script defer src="../js/VirtualBackground.js"></script>
<script defer src="../js/RoomClient.js"></script>
<script defer src="../js/Room.js"></script>
<script defer src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>