Skip to content

Agora Video Meetings V0.5 #418

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: agora-rtm-sdk installation error
  • Loading branch information
freddysundowner committed Oct 20, 2023
commit 47fb1245b2eac67ce5c8c988146eedf0cae5e6d9
1 change: 1 addition & 0 deletions client/packages/lowcoder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"@types/react-virtualized": "^9.21.21",
"agora-access-token": "^2.0.4",
"agora-rtc-sdk-ng": "^4.19.0",
"agora-rtm-sdk": "^1.5.1",
"ali-oss": "^6.17.1",
"antd": "5.7.2",
"antd-img-crop": "^4.12.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { useUserViewMode } from "util/hooks";
import { isNumeric } from "util/stringUtils";
import { NameConfig, withExposingConfigs } from "../../generators/withExposing";

import axios from "axios";
import AgoraRTC, {
ICameraVideoTrack,
IMicrophoneAudioTrack,
Expand Down Expand Up @@ -109,6 +110,15 @@ let userId: UID | null | undefined;
let rtmChannelResponse: RtmChannel;
let rtmClient: RtmClient;

const generateToken = async (
appId: any,
certificate: any,
channelName: any
) => {
const agoraTokenUrl = `https://api.agora.io/v1/token?channelName=test&uid=${userId}&appID=${appId}&appCertificate=${certificate}`;
await axios.post(agoraTokenUrl);
};

const turnOnCamera = async (flag?: boolean) => {
if (videoTrack) {
return videoTrack.setEnabled(flag!);
Expand Down Expand Up @@ -164,7 +174,18 @@ const leaveChannel = async () => {

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

const publishVideo = async (appId: any, channel: any, height: any) => {
const publishVideo = async (
appId: string,
channel: any,
height: any,
certifiCateKey: string
) => {
// console.log(
// "generateToken",
// await generateToken(appId, certifiCateKey, channel)
// );

// return;
await turnOnCamera(true);
await client.join(appId, channel, null, userId);
await client.publish(videoTrack);
Expand Down Expand Up @@ -254,6 +275,7 @@ export const meetingControllerChildren = {
usersScreenShared: stateComp<JSONValue>([]),
localUser: jsonObjectExposingStateControl(""),
meetingName: stringExposingStateControl("meetingName"),
certifiCateKey: stringExposingStateControl(""),
messages: stateComp<JSONValue>([]),
};
let MTComp = (function () {
Expand Down Expand Up @@ -414,6 +436,10 @@ let MTComp = (function () {
<>
<Section name={sectionNames.basic}>
{children.appId.propertyView({ label: trans("meeting.appid") })}
{children.certifiCateKey.propertyView({
label: trans("meeting.certifiCateKey"),
})}

{children.meetingName.propertyView({
label: trans("meeting.meetingName"),
})}
Expand Down Expand Up @@ -532,7 +558,8 @@ MTComp = withMethodExposing(MTComp, [
comp.children.meetingName.getView().value == ""
? "_meetingId"
: comp.children.meetingName.getView().value,
comp.children
comp.children,
comp.children.certifiCateKey.getView().value
);
},
},
Expand Down
1 change: 1 addition & 0 deletions client/packages/lowcoder/src/i18n/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ export const en = {
height: "Drawer height",
actionBtnDesc: "Action Button",
broadCast: "BroadCast Messages",
certifiCateKey: "certifiCate Key",
title: "Meeting title",
meetingCompName: "Meeting Controller",
videoCompName: "Video Stream",
Expand Down