Skip to content

Commit

Permalink
feat(service-providers): add RTM 2.0 (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored Jun 24, 2024
1 parent 2ed815a commit 99d8f12
Show file tree
Hide file tree
Showing 13 changed files with 641 additions and 16 deletions.
1 change: 1 addition & 0 deletions desktop/renderer-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"@netless/flat-service-provider-agora-cloud-recording": "workspace:*",
"@netless/flat-service-provider-agora-rtc-electron": "workspace:*",
"@netless/flat-service-provider-agora-rtm": "workspace:*",
"@netless/flat-service-provider-agora-rtm2": "workspace:*",
"@netless/flat-service-provider-fastboard": "workspace:*",
"@netless/flat-service-provider-file-convert-h5": "workspace:*",
"@netless/flat-service-provider-file-convert-netless": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions desktop/renderer-app/src/tasks/init-flat-services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ export function initFlatServices(): void {
});

flatServices.register("textChat", async () => {
const { AgoraRTM } = await import("@netless/flat-service-provider-agora-rtm");
return new AgoraRTM(config.agora.appId);
const { AgoraRTM2 } = await import("@netless/flat-service-provider-agora-rtm2");
return new AgoraRTM2(config.agora.appId);
});

flatServices.register("whiteboard", async () => {
Expand Down
1 change: 1 addition & 0 deletions packages/flat-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@netless/flat-server-api": "workspace:*",
"@netless/flat-service-provider-agora-rtc-web": "workspace:*",
"@netless/flat-service-provider-agora-rtm": "workspace:*",
"@netless/flat-service-provider-agora-rtm2": "workspace:*",
"@netless/flat-services": "workspace:*",
"@netless/flat-stores": "workspace:*",
"@netless/sync-player": "^1.0.7",
Expand Down
1 change: 1 addition & 0 deletions packages/flat-stores/src/classroom-store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,7 @@ export class ClassroomStore {

public async destroy(): Promise<void> {
this.sideEffect.flushAll();
(window as any).classroomStore = null;

await this.stopRecording();

Expand Down
163 changes: 153 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service-providers/agora-rtc/agora-rtc-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"dependencies": {
"@netless/flat-services": "workspace:*",
"agora-rtc-sdk-ng": "4.16.0",
"agora-rtc-sdk-ng": "^4.20.0",
"side-effect-manager": "^1.2.1",
"value-enhancer": "^1.3.2"
}
Expand Down
3 changes: 3 additions & 0 deletions service-providers/agora-rtm2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# @netless/flat-service-provider-agora-rtm2

Implements the `textChat` Flat service.
22 changes: 22 additions & 0 deletions service-providers/agora-rtm2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "@netless/flat-service-provider-agora-rtm2",
"version": "0.1.0",
"description": "Agora Realtime Messaging 2.0",
"main": "src/index.ts",
"private": true,
"license": "MIT",
"scripts": {
"build": "tsc"
},
"devDependencies": {
"prettier": "^3.2.4",
"typescript": "^4.8.3"
},
"dependencies": {
"@netless/flat-server-api": "workspace:*",
"@netless/flat-services": "workspace:*",
"agora-rtm": "^2.1.10",
"side-effect-manager": "^1.2.1",
"uuid": "^9.0.0"
}
}
1 change: 1 addition & 0 deletions service-providers/agora-rtm2/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./rtm2";
Loading

0 comments on commit 99d8f12

Please sign in to comment.