Skip to content

Commit 62c21f0

Browse files
fix: profile image showing when audio is toggled
1 parent 385b89f commit 62c21f0

File tree

2 files changed

+36
-12
lines changed

2 files changed

+36
-12
lines changed

client/packages/lowcoder/src/comps/comps/meetingComp/videoMeetingControllerComp.tsx

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
2929
import { CanvasContainerID } from "constants/domLocators";
3030
import { Layers } from "constants/Layers";
3131
import { trans } from "i18n";
32-
import { changeChildAction } from "lowcoder-core";
32+
import { changeChildAction, changeValueAction } from "lowcoder-core";
3333
import {
3434
Drawer,
3535
HintPlaceHolder,
@@ -282,6 +282,7 @@ let MTComp = (function () {
282282
userid: null,
283283
});
284284
const [rtmMessages, setRtmMessages] = useState<any>([]);
285+
const [localUserSpeaking, setLocalUserSpeaking] = useState<any>(false);
285286

286287
useEffect(() => {
287288
dispatch(
@@ -325,6 +326,18 @@ let MTComp = (function () {
325326
}
326327
}, [rtmMessages]);
327328

329+
useEffect(() => {
330+
if (localUserSpeaking === true) {
331+
let localObject = {
332+
user: userId + "",
333+
audiostatus: props.audioControl.value,
334+
streamingVideo: props.videoControl.value,
335+
speaking: localUserSpeaking,
336+
};
337+
props.localUser.onChange(localObject);
338+
}
339+
}, [localUserSpeaking]);
340+
328341
useEffect(() => {
329342
if (props.localUser.value) {
330343
let newUsers = userIds.filter((item: any) => item.user !== userId);
@@ -387,13 +400,7 @@ let MTComp = (function () {
387400
volumeInfo.uid == userId &&
388401
props.localUser.value.speaking != speaking
389402
) {
390-
let localObject = {
391-
user: userId + "",
392-
audiostatus: props.audioControl.value,
393-
streamingVideo: props.videoControl.value,
394-
speaking: speaking,
395-
};
396-
props.localUser.onChange(localObject);
403+
setLocalUserSpeaking(speaking);
397404
} else {
398405
setUpdateVolume({ update: speaking, userid: volumeInfo.uid });
399406
}
@@ -574,12 +581,14 @@ MTComp = withMethodExposing(MTComp, [
574581
} else {
575582
await turnOnCamera(value);
576583
}
577-
comp.children.localUser.change({
584+
let localData = {
578585
user: userId + "",
579586
streamingVideo: value,
580-
audiostatus: false,
581-
speaking: false,
582-
});
587+
audiostatus: comp.children.audioControl.getView().value,
588+
speaking: comp.children.localUser.getView().value.speaking,
589+
};
590+
591+
comp.children.localUser.change(localData);
583592
comp.children.videoControl.change(value);
584593
},
585594
},
@@ -598,6 +607,19 @@ MTComp = withMethodExposing(MTComp, [
598607
streamingVideo: true,
599608
});
600609

610+
comp.children.localUser.children.value.dispatch(
611+
changeChildAction(
612+
"localUser",
613+
{
614+
user: userId + "",
615+
audiostatus: false,
616+
speaking: false,
617+
streamingVideo: true,
618+
},
619+
false
620+
)
621+
);
622+
comp.children.videoControl.change(true);
601623
await publishVideo(
602624
comp.children.appId.getView(),
603625
comp.children.meetingName.getView().value == ""

client/packages/lowcoder/src/comps/comps/meetingComp/videoMeetingStreamComp.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,8 @@ let VideoCompBuilder = (function (props) {
287287
}
288288
);
289289

290+
console.log(userData);
291+
290292
setUserId(userData.user);
291293
setUsername(userData.userName);
292294
}

0 commit comments

Comments
 (0)