Skip to content

Commit b9bce7c

Browse files
added agora token
1 parent d459a73 commit b9bce7c

File tree

2 files changed

+36
-17
lines changed

2 files changed

+36
-17
lines changed

client/packages/lowcoder/src/comps/comps/layout/mobileTabLayout.tsx

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ function TabBarView(props: TabBarProps) {
8686
activeKey={props.selectedKey}
8787
>
8888
{props.tabs.map((tab) => {
89-
return <TabBarItem key={tab.key} icon={tab.icon} title={tab.title} />;
89+
return (
90+
<TabBarItem key={tab.key} icon={tab.icon} title={tab.title} />
91+
);
9092
})}
9193
</TabBar>
9294
</TabBarWrapper>
@@ -126,9 +128,18 @@ let MobileTabLayoutTmp = (function () {
126128
const childrenMap = {
127129
tabs: manualOptionsControl(TabOptionComp, {
128130
initOptions: [
129-
{ label: trans("optionsControl.optionI", { i: 1 }), icon: "/icon:solid/1" },
130-
{ label: trans("optionsControl.optionI", { i: 2 }), icon: "/icon:solid/2" },
131-
{ label: trans("optionsControl.optionI", { i: 3 }), icon: "/icon:solid/3" },
131+
{
132+
label: trans("optionsControl.optionI", { i: 1 }),
133+
icon: "/icon:solid/1",
134+
},
135+
{
136+
label: trans("optionsControl.optionI", { i: 2 }),
137+
icon: "/icon:solid/2",
138+
},
139+
{
140+
label: trans("optionsControl.optionI", { i: 3 }),
141+
icon: "/icon:solid/3",
142+
},
132143
],
133144
}),
134145
};
@@ -138,7 +149,9 @@ let MobileTabLayoutTmp = (function () {
138149
.setPropertyViewFn((children) => {
139150
return (
140151
<>
141-
<Section name={trans("aggregation.tabBar")}>{children.tabs.propertyView({})}</Section>
152+
<Section name={trans("aggregation.tabBar")}>
153+
{children.tabs.propertyView({})}
154+
</Section>
142155
</>
143156
);
144157
})
@@ -168,7 +181,9 @@ MobileTabLayoutTmp = withViewFn(MobileTabLayoutTmp, (comp) => {
168181
tabs={tabViews.map((tab, index) => ({
169182
key: index,
170183
title: tab.children.label.getView(),
171-
icon: tab.children.icon.toJsonValue() ? tab.children.icon.getView() : undefined,
184+
icon: tab.children.icon.toJsonValue()
185+
? tab.children.icon.getView()
186+
: undefined,
172187
}))}
173188
selectedKey={tabIndex + ""}
174189
onChange={(key) => setTabIndex(Number(key))}

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

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@ export const client: IAgoraRTCClient = AgoraRTC.createClient({
103103
mode: "rtc",
104104
codec: "vp8",
105105
});
106+
AgoraRTC.setLogLevel(3);
107+
106108
let audioTrack: IMicrophoneAudioTrack;
107109
let videoTrack: ICameraVideoTrack;
108110
let screenShareStream: ILocalVideoTrack;
@@ -115,8 +117,13 @@ const generateToken = async (
115117
certificate: any,
116118
channelName: any
117119
) => {
118-
const agoraTokenUrl = `https://api.agora.io/v1/token?channelName=test&uid=${userId}&appID=${appId}&appCertificate=${certificate}`;
119-
await axios.post(agoraTokenUrl);
120+
const agoraTokenUrl = `https://sandbox.wiggolive.com/token/rtc`;
121+
let response = await axios.post(agoraTokenUrl, {
122+
appId,
123+
certificate,
124+
channelName,
125+
});
126+
return response.data;
120127
};
121128

122129
const turnOnCamera = async (flag?: boolean) => {
@@ -180,14 +187,13 @@ const publishVideo = async (
180187
height: any,
181188
certifiCateKey: string
182189
) => {
183-
// console.log(
184-
// "generateToken",
185-
// await generateToken(appId, certifiCateKey, channel)
186-
// );
187-
188-
// return;
190+
console.log(appId, certifiCateKey, channel);
191+
let token = null;
192+
if (certifiCateKey) {
193+
token = await generateToken(appId, certifiCateKey, channel);
194+
}
189195
await turnOnCamera(true);
190-
await client.join(appId, channel, null, userId);
196+
await client.join(appId, channel, token, userId);
191197
await client.publish(videoTrack);
192198

193199
await rtmInit(appId, userId, channel);
@@ -581,8 +587,6 @@ MTComp = withMethodExposing(MTComp, [
581587
};
582588
message["data"] = otherData;
583589

584-
console.log(toUsers);
585-
586590
if (toUsers.length > 0 && toUsers[0] !== undefined) {
587591
let peers = toUsers?.map((u: any) => u.user);
588592
console.log("peers", peers);

0 commit comments

Comments
 (0)