Skip to content

Commit 167211d

Browse files
feat: exposed meeting active bool and also fixed image padding issue
1 parent 62c21f0 commit 167211d

File tree

2 files changed

+29
-31
lines changed

2 files changed

+29
-31
lines changed

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

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ import { BoolControl } from "comps/controls/boolControl";
1010
import { StringControl } from "comps/controls/codeControl";
1111
import {
1212
booleanExposingStateControl,
13+
BooleanStateControl,
1314
jsonObjectExposingStateControl,
14-
numberExposingStateControl,
15-
numberStateControl,
16-
stringExposingStateControl,
1715
stringStateControl,
1816
} from "comps/controls/codeStateControl";
1917
import { PositionControl } from "comps/controls/dropdownControl";
@@ -29,7 +27,7 @@ import { BackgroundColorContext } from "comps/utils/backgroundColorContext";
2927
import { CanvasContainerID } from "constants/domLocators";
3028
import { Layers } from "constants/Layers";
3129
import { trans } from "i18n";
32-
import { changeChildAction, changeValueAction } from "lowcoder-core";
30+
import { changeChildAction } from "lowcoder-core";
3331
import {
3432
Drawer,
3533
HintPlaceHolder,
@@ -55,7 +53,7 @@ import AgoraRTC, {
5553

5654
import { JSONValue } from "@lowcoder-ee/index.sdk";
5755
import { getData } from "../listViewComp/listViewUtils";
58-
import AgoraRTM, { RtmChannel, RtmClient, RtmMessage } from "agora-rtm-sdk";
56+
import AgoraRTM, { RtmChannel, RtmClient } from "agora-rtm-sdk";
5957

6058
const EventOptions = [closeEvent] as const;
6159

@@ -113,13 +111,13 @@ let screenShareStream: ILocalVideoTrack;
113111
let userId: UID | null | undefined;
114112
let rtmChannelResponse: RtmChannel;
115113
let rtmClient: RtmClient;
114+
const agoraTokenUrl = `https://sandbox.wiggolive.com/token/rtc`;
116115

117116
const generateToken = async (
118117
appId: any,
119118
certificate: any,
120119
channelName: any
121120
) => {
122-
const agoraTokenUrl = `https://sandbox.wiggolive.com/token/rtc`;
123121
let response = await axios.post(agoraTokenUrl, {
124122
appId,
125123
certificate,
@@ -204,8 +202,8 @@ const publishVideo = async (
204202
const videoSettings = mediaStreamTrack.getSettings();
205203
const videoWidth = videoSettings.width;
206204
const videoHeight = videoSettings.height;
207-
height.videoWidth.change(videoWidth);
208-
height.videoHeight.change(videoHeight);
205+
// height.videoWidth.change(videoWidth);
206+
// height.videoHeight.change(videoHeight);
209207
}
210208
};
211209

@@ -230,7 +228,7 @@ const rtmInit = async (appId: any, uid: any, channel: any) => {
230228
};
231229

232230
export const meetingControllerChildren = {
233-
visible: booleanExposingStateControl("visible"),
231+
visible: withDefault(BooleanStateControl, "visible"),
234232
onEvent: eventHandlerControl(EventOptions),
235233
width: StringControl,
236234
height: StringControl,
@@ -239,20 +237,17 @@ export const meetingControllerChildren = {
239237
placement: PositionControl,
240238
maskClosable: withDefault(BoolControl, true),
241239
showMask: withDefault(BoolControl, true),
242-
audioControl: booleanExposingStateControl("false"),
243-
videoControl: booleanExposingStateControl("true"),
244-
endCall: booleanExposingStateControl("false"),
245-
sharing: booleanExposingStateControl("false"),
246-
videoSettings: jsonObjectExposingStateControl(""),
247-
videoWidth: numberStateControl(200),
248-
videoHeight: numberStateControl(200),
240+
meetingActive: withDefault(BooleanStateControl, "false"),
241+
audioControl: withDefault(BooleanStateControl, "false"),
242+
videoControl: withDefault(BooleanStateControl, "true"),
243+
endCall: withDefault(BooleanStateControl, "false"),
244+
sharing: withDefault(BooleanStateControl, "false"),
249245
appId: withDefault(StringControl, trans("meeting.appid")),
250246
participants: stateComp<JSONValue>([]),
251247
usersScreenShared: stateComp<JSONValue>([]),
252248
localUser: jsonObjectExposingStateControl(""),
253249
meetingName: stringStateControl("meetingName"),
254-
userName: stringStateControl("userName"),
255-
certifiCateKey: stringExposingStateControl(""),
250+
certifiCateKey: stringStateControl(""),
256251
messages: stateComp<JSONValue>([]),
257252
};
258253
let MTComp = (function () {
@@ -628,6 +623,7 @@ MTComp = withMethodExposing(MTComp, [
628623
comp.children,
629624
comp.children.certifiCateKey.getView().value
630625
);
626+
comp.children.meetingActive.change(true);
631627
},
632628
},
633629
{
@@ -690,6 +686,7 @@ MTComp = withMethodExposing(MTComp, [
690686
execute: async (comp, values) => {
691687
let value = !comp.children.endCall.getView().value;
692688
comp.children.endCall.change(value);
689+
comp.children.meetingActive.change(false);
693690

694691
await leaveChannel();
695692

@@ -716,6 +713,8 @@ export const VideoMeetingControllerComp = withExposingConfigs(MTComp, [
716713
new NameConfig("appId", trans("meeting.appid")),
717714
new NameConfig("localUser", trans("meeting.host")),
718715
new NameConfig("participants", trans("meeting.participants")),
716+
new NameConfig("meetingActive", trans("meeting.meetingName")),
719717
new NameConfig("meetingName", trans("meeting.meetingName")),
720718
new NameConfig("messages", trans("meeting.meetingName")),
721719
]);
720+

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

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ const typeOptions = [
169169
export const meetingStreamChildren = {
170170
autoHeight: withDefault(AutoHeightControl, "fixed"),
171171
shareScreen: withDefault(BoolShareVideoControl, false),
172-
profileImageHeight: withDefault(StringControl, "300px"),
173-
profileImageWidth: withDefault(StringControl, "300px"),
172+
profilePadding: withDefault(StringControl, "0px"),
173+
profileBorderRadius: withDefault(StringControl, "0px"),
174174
type: dropdownControl(typeOptions, ""),
175175
onEvent: MeetingEventHandlerControl,
176176
disabled: BoolCodeControl,
@@ -287,8 +287,6 @@ let VideoCompBuilder = (function (props) {
287287
}
288288
);
289289

290-
console.log(userData);
291-
292290
setUserId(userData.user);
293291
setUsername(userData.userName);
294292
}
@@ -319,9 +317,8 @@ let VideoCompBuilder = (function (props) {
319317
>
320318
<img
321319
style={{
322-
borderRadius: "50%",
323-
width: props.profileImageWidth,
324-
height: props.profileImageHeight,
320+
padding: props.profilePadding,
321+
borderRadius: props.profileBorderRadius,
325322
}}
326323
src={props.profileImageUrl.value}
327324
/>
@@ -332,9 +329,9 @@ let VideoCompBuilder = (function (props) {
332329
<TextContainer $style={props.style}>
333330
<img
334331
style={{
335-
borderRadius: "50%",
336-
width: props.profileImageWidth,
337-
height: props.profileImageHeight,
332+
padding: props.profilePadding,
333+
width: "100%",
334+
borderRadius: props.profileBorderRadius,
338335
}}
339336
src={props.profileImageUrl.value}
340337
/>
@@ -367,10 +364,12 @@ let VideoCompBuilder = (function (props) {
367364
label: trans("meeting.profileImageUrl"),
368365
placeholder: "https://via.placeholder.com/120",
369366
})}
370-
{children.profileImageHeight.propertyView({
371-
label: "Profile Height",
367+
{children.profilePadding.propertyView({
368+
label: "Profile Padding",
369+
})}
370+
{children.profileBorderRadius.propertyView({
371+
label: "Profile Border Radius",
372372
})}
373-
{children.profileImageWidth.propertyView({ label: "Profile Width" })}
374373
{children.style.getPropertyView()}
375374
</Section>
376375
</>

0 commit comments

Comments
 (0)