Skip to content

Commit 47fb124

Browse files
fix: agora-rtm-sdk installation error
1 parent ebc4bc4 commit 47fb124

File tree

3 files changed

+31
-2
lines changed

3 files changed

+31
-2
lines changed

client/packages/lowcoder/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"@types/react-virtualized": "^9.21.21",
3939
"agora-access-token": "^2.0.4",
4040
"agora-rtc-sdk-ng": "^4.19.0",
41+
"agora-rtm-sdk": "^1.5.1",
4142
"ali-oss": "^6.17.1",
4243
"antd": "5.7.2",
4344
"antd-img-crop": "^4.12.2",

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

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { useUserViewMode } from "util/hooks";
4141
import { isNumeric } from "util/stringUtils";
4242
import { NameConfig, withExposingConfigs } from "../../generators/withExposing";
4343

44+
import axios from "axios";
4445
import AgoraRTC, {
4546
ICameraVideoTrack,
4647
IMicrophoneAudioTrack,
@@ -109,6 +110,15 @@ let userId: UID | null | undefined;
109110
let rtmChannelResponse: RtmChannel;
110111
let rtmClient: RtmClient;
111112

113+
const generateToken = async (
114+
appId: any,
115+
certificate: any,
116+
channelName: any
117+
) => {
118+
const agoraTokenUrl = `https://api.agora.io/v1/token?channelName=test&uid=${userId}&appID=${appId}&appCertificate=${certificate}`;
119+
await axios.post(agoraTokenUrl);
120+
};
121+
112122
const turnOnCamera = async (flag?: boolean) => {
113123
if (videoTrack) {
114124
return videoTrack.setEnabled(flag!);
@@ -164,7 +174,18 @@ const leaveChannel = async () => {
164174

165175
const hostChanged = (users: any) => {};
166176

167-
const publishVideo = async (appId: any, channel: any, height: any) => {
177+
const publishVideo = async (
178+
appId: string,
179+
channel: any,
180+
height: any,
181+
certifiCateKey: string
182+
) => {
183+
// console.log(
184+
// "generateToken",
185+
// await generateToken(appId, certifiCateKey, channel)
186+
// );
187+
188+
// return;
168189
await turnOnCamera(true);
169190
await client.join(appId, channel, null, userId);
170191
await client.publish(videoTrack);
@@ -254,6 +275,7 @@ export const meetingControllerChildren = {
254275
usersScreenShared: stateComp<JSONValue>([]),
255276
localUser: jsonObjectExposingStateControl(""),
256277
meetingName: stringExposingStateControl("meetingName"),
278+
certifiCateKey: stringExposingStateControl(""),
257279
messages: stateComp<JSONValue>([]),
258280
};
259281
let MTComp = (function () {
@@ -414,6 +436,10 @@ let MTComp = (function () {
414436
<>
415437
<Section name={sectionNames.basic}>
416438
{children.appId.propertyView({ label: trans("meeting.appid") })}
439+
{children.certifiCateKey.propertyView({
440+
label: trans("meeting.certifiCateKey"),
441+
})}
442+
417443
{children.meetingName.propertyView({
418444
label: trans("meeting.meetingName"),
419445
})}
@@ -532,7 +558,8 @@ MTComp = withMethodExposing(MTComp, [
532558
comp.children.meetingName.getView().value == ""
533559
? "_meetingId"
534560
: comp.children.meetingName.getView().value,
535-
comp.children
561+
comp.children,
562+
comp.children.certifiCateKey.getView().value
536563
);
537564
},
538565
},

client/packages/lowcoder/src/i18n/locales/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,6 +1464,7 @@ export const en = {
14641464
height: "Drawer height",
14651465
actionBtnDesc: "Action Button",
14661466
broadCast: "BroadCast Messages",
1467+
certifiCateKey: "certifiCate Key",
14671468
title: "Meeting title",
14681469
meetingCompName: "Meeting Controller",
14691470
videoCompName: "Video Stream",

0 commit comments

Comments
 (0)