This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 554f405cb [OPENMEETINGS-2253] self-echo fixed, again
554f405cb is described below

commit 554f405cb40b84e4cda825d66356ca580132976a
Author: Maxim Solodovnik <[email protected]>
AuthorDate: Wed Dec 21 22:40:53 2022 +0700

    [OPENMEETINGS-2253] self-echo fixed, again
---
 openmeetings-web/src/main/front/room/src/video.js          | 6 +++---
 openmeetings-web/src/main/front/settings/src/settings.js   | 4 ++--
 openmeetings-web/src/main/front/settings/src/video-util.js | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/openmeetings-web/src/main/front/room/src/video.js 
b/openmeetings-web/src/main/front/room/src/video.js
index 6f0a9582b..72c664cd5 100644
--- a/openmeetings-web/src/main/front/room/src/video.js
+++ b/openmeetings-web/src/main/front/room/src/video.js
@@ -170,7 +170,7 @@ module.exports = class Video {
                                , onConnectionStateChange: () => 
__connectionStateChangeListener(state)
                        };
                        const vid = __getVideo(state);
-                       VideoUtil.playSrc(vid, state.stream);
+                       VideoUtil.playSrc(vid, state.stream, true);
 
                        const data = state.data;
                        data.rtcPeer = new 
WebRtcPeerSendonly(VideoUtil.addIceServers(state.options, msg));
@@ -394,7 +394,7 @@ module.exports = class Video {
                                        v.remove();
                                        __initUI(v.data('instance-uid'));
                                        __createVideo(state);
-                                       VideoUtil.playSrc(state.video[0], 
state.stream || state.rStream);
+                                       VideoUtil.playSrc(state.video[0], 
state.stream || state.rStream, sd.self);
                                        if (state.data.analyser) {
                                                lm = vc.find('.level-meter');
                                                level.setCanvas(lm);
@@ -598,7 +598,7 @@ module.exports = class Video {
                                .then(() => {
                                        const video = __getVideo(state);
                                        state.rStream = 
state.data.rtcPeer.pc.getRemoteStreams()[0];
-                                       VideoUtil.playSrc(video, state.rStream);
+                                       VideoUtil.playSrc(video, state.rStream, 
false);
                                })
                                .catch(error => OmUtil.error(error, true));
                }
diff --git a/openmeetings-web/src/main/front/settings/src/settings.js 
b/openmeetings-web/src/main/front/settings/src/settings.js
index 795108ff1..6623ba8d0 100644
--- a/openmeetings-web/src/main/front/settings/src/settings.js
+++ b/openmeetings-web/src/main/front/settings/src/settings.js
@@ -209,7 +209,7 @@ function _readValues(msg, func) {
                        }, msg);
                        navigator.mediaDevices.getUserMedia(cnts)
                                .then(stream => {
-                                       VideoUtil.playSrc(vid[0], stream);
+                                       VideoUtil.playSrc(vid[0], stream, true);
                                        options.mediaStream = stream;
 
                                        rtcPeer = new 
WebRtcPeerSendonly(options);
@@ -406,7 +406,7 @@ function _onKMessage(m) {
                                .then(() => {
                                        const stream = rtcPeer.stream;
                                        if (stream) {
-                                               VideoUtil.playSrc(vid[0], 
stream);
+                                               VideoUtil.playSrc(vid[0], 
stream, false);
                                                lm.show();
                                                level = new MicLevel();
                                                level.meterStream(stream, lm, 
function(){}, OmUtil.error, true);
diff --git a/openmeetings-web/src/main/front/settings/src/video-util.js 
b/openmeetings-web/src/main/front/settings/src/video-util.js
index 7ca532edb..02adb6d59 100644
--- a/openmeetings-web/src/main/front/settings/src/video-util.js
+++ b/openmeetings-web/src/main/front/settings/src/video-util.js
@@ -285,13 +285,13 @@ function _highlight(el, clazz, count) {
                next();
        });
 }
-function _playSrc(_video, _stream) {
+function _playSrc(_video, _stream, mute) {
        if (_stream && _video) {
                _video.srcObject = _stream;
                if (_video.paused) {
-                       _video.play().catch(err => {
+                       _video.play().then(() => _video.muted = mute).catch(err 
=> {
                                if ('NotAllowedError' === err.name) {
-                                       _askPermission(() => _video.play());
+                                       _askPermission(() => 
_video.play().then(() => _video.muted = mute));
                                }
                        });
                }

Reply via email to