File tree 10 files changed +6
-40
lines changed
flat-services/src/services
10 files changed +6
-40
lines changed Original file line number Diff line number Diff line change @@ -103,7 +103,6 @@ export interface JoinRoomResult {
103
103
rtmToken : string ;
104
104
showGuide : boolean ;
105
105
region : Region ;
106
- agoraAppId ?: string ;
107
106
billing ?: {
108
107
/** minutes */
109
108
limit : number ;
Original file line number Diff line number Diff line change @@ -14,7 +14,6 @@ export interface IServiceTextChatJoinRoomConfig {
14
14
ownerUUID : string ;
15
15
uid : string ;
16
16
token ?: string | null ;
17
- agoraAppId ?: string | null ;
18
17
}
19
18
20
19
export abstract class IServiceTextChat implements IService {
Original file line number Diff line number Diff line change @@ -30,7 +30,6 @@ export interface IServiceVideoChatJoinRoomConfig {
30
30
shareScreenUID : IServiceVideoChatUID ;
31
31
shareScreenToken : string ;
32
32
mirror ?: boolean ;
33
- agoraAppId ?: string | null ;
34
33
}
35
34
36
35
export abstract class IServiceVideoChat implements IService {
Original file line number Diff line number Diff line change @@ -376,7 +376,6 @@ export class ClassroomStore {
376
376
ownerUUID : this . ownerUUID ,
377
377
uid : this . userUUID ,
378
378
token : globalStore . rtmToken ,
379
- agoraAppId : globalStore . agoraAppId ,
380
379
} ) ;
381
380
382
381
const fastboard = await this . whiteboardStore . joinWhiteboardRoom ( ) ;
@@ -1509,7 +1508,6 @@ export class ClassroomStore {
1509
1508
shareScreenUID : String ( globalStore . rtcShareScreen ?. uid || - 1 ) ,
1510
1509
shareScreenToken : globalStore . rtcShareScreen ?. token || "" ,
1511
1510
mirror : preferencesStore . mirrorMode ,
1512
- agoraAppId : globalStore . agoraAppId ,
1513
1511
} ) ;
1514
1512
1515
1513
if ( preferencesStore . cameraId ) {
Original file line number Diff line number Diff line change @@ -67,7 +67,6 @@ export class GlobalStore {
67
67
* Room's region, services (currently only whiteboard) must use this value to join the room.
68
68
*/
69
69
public region : Region | null = null ;
70
- public agoraAppId : string | null = null ;
71
70
public rtcToken : string | null = null ;
72
71
public rtcUID : number | null = null ;
73
72
public rtcShareScreen : {
@@ -220,7 +219,6 @@ export class GlobalStore {
220
219
| "rtcUID"
221
220
| "rtcShareScreen"
222
221
| "region"
223
- | "agoraAppId"
224
222
>
225
223
> ,
226
224
) : void => {
@@ -232,7 +230,6 @@ export class GlobalStore {
232
230
"rtcUID" ,
233
231
"rtcShareScreen" ,
234
232
"region" ,
235
- "agoraAppId" ,
236
233
] as const ;
237
234
for ( const key of keys ) {
238
235
const value = config [ key ] ;
Original file line number Diff line number Diff line change @@ -57,7 +57,6 @@ export interface RoomItem {
57
57
expireAt : number ;
58
58
vipLevel : 0 | 1 ;
59
59
} ;
60
- agoraAppId ?: string ;
61
60
}
62
61
63
62
// Only keep sub-room ids. sub-room info are stored in ordinaryRooms.
@@ -145,7 +144,6 @@ export class RoomStore {
145
144
ownerUUID : data . ownerUUID ,
146
145
roomType : data . roomType ,
147
146
billing : data . billing ,
148
- agoraAppId : data . agoraAppId ,
149
147
} ) ;
150
148
return data ;
151
149
}
Original file line number Diff line number Diff line change @@ -32,12 +32,11 @@ export class AgoraRTCElectron extends IServiceVideoChat {
32
32
public readonly isMac : boolean ;
33
33
public readonly shareScreen = new AgoraRTCElectronShareScreen ( { rtc : this } ) ;
34
34
35
+ public readonly APP_ID : string ;
35
36
public readonly rtcEngine : AgoraSdk ;
36
37
37
38
private readonly _roomSideEffect = new SideEffectManager ( ) ;
38
39
39
- public APP_ID : string ;
40
-
41
40
private _cameraID ?: string ;
42
41
private _micID ?: string ;
43
42
private _speakerID ?: string ;
@@ -204,12 +203,6 @@ export class AgoraRTCElectron extends IServiceVideoChat {
204
203
}
205
204
this . leaveRoom ( ) ;
206
205
}
207
-
208
- if ( config . agoraAppId && config . agoraAppId !== this . APP_ID ) {
209
- this . rtcEngine . release ( true ) ;
210
- this . rtcEngine . initialize ( ( this . APP_ID = config . agoraAppId ) ) ;
211
- }
212
-
213
206
return this . _join ( config ) ;
214
207
}
215
208
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ export interface AgoraRTCWebConfig {
42
42
}
43
43
44
44
export class AgoraRTCWeb extends IServiceVideoChat {
45
+ public readonly APP_ID : string ;
46
+
45
47
public readonly shareScreen : AgoraRTCWebShareScreen ;
46
48
47
49
private readonly _roomSideEffect = new SideEffectManager ( ) ;
@@ -50,7 +52,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
50
52
private _pLeavingRoom ?: Promise < unknown > ;
51
53
private _testingAudio ?: HTMLAudioElement ;
52
54
53
- public APP_ID : string ;
54
55
public client ?: IAgoraRTCClient ;
55
56
public mode ?: IServiceVideoChatMode ;
56
57
@@ -357,7 +358,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
357
358
shareScreenUID,
358
359
shareScreenToken,
359
360
mirror,
360
- agoraAppId,
361
361
} : IServiceVideoChatJoinRoomConfig ) : Promise < void > {
362
362
this . _roomSideEffect . flushAll ( ) ;
363
363
@@ -494,10 +494,6 @@ export class AgoraRTCWeb extends IServiceVideoChat {
494
494
} ) ,
495
495
) ;
496
496
497
- if ( agoraAppId && agoraAppId !== this . APP_ID ) {
498
- this . APP_ID = agoraAppId ;
499
- }
500
-
501
497
await client . join (
502
498
this . APP_ID ,
503
499
roomUUID ,
Original file line number Diff line number Diff line change @@ -24,14 +24,14 @@ export class AgoraRTM extends IServiceTextChat {
24
24
private _pJoiningRoom ?: Promise < unknown > ;
25
25
private _pLeavingRoom ?: Promise < unknown > ;
26
26
27
- public client : RtmClient ;
27
+ public readonly client : RtmClient ;
28
28
public channel ?: RtmChannel ;
29
29
30
30
private roomUUID ?: string ;
31
31
private userUUID ?: string ;
32
32
private token ?: string ;
33
33
34
- public constructor ( public APP_ID : string ) {
34
+ public constructor ( APP_ID : string ) {
35
35
super ( ) ;
36
36
if ( ! APP_ID ) {
37
37
throw new Error ( "APP_ID is not set" ) ;
@@ -185,21 +185,13 @@ export class AgoraRTM extends IServiceTextChat {
185
185
token,
186
186
roomUUID,
187
187
ownerUUID,
188
- agoraAppId,
189
188
} : IServiceTextChatJoinRoomConfig ) : Promise < void > {
190
189
this . token = token || ( await generateRTMToken ( ) ) ;
191
190
192
191
if ( ! this . token ) {
193
192
throw new Error ( "Missing Agora RTM token" ) ;
194
193
}
195
194
196
- if ( agoraAppId && agoraAppId !== this . APP_ID ) {
197
- this . APP_ID = agoraAppId ;
198
- this . client = RtmEngine . createInstance ( this . APP_ID , {
199
- logFilter : RtmEngine . LOG_FILTER_WARNING ,
200
- } ) ;
201
- }
202
-
203
195
this . _roomSideEffect . add ( ( ) => {
204
196
const handler = async ( ) : Promise < void > => {
205
197
this . token = await generateRTMToken ( ) ;
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ export class AgoraRTM2 extends IServiceTextChat {
28
28
private userUUID ?: string ;
29
29
private token ?: string ;
30
30
31
- public constructor ( public APP_ID : string ) {
31
+ public constructor ( private readonly APP_ID : string ) {
32
32
super ( ) ;
33
33
if ( ! APP_ID ) {
34
34
throw new Error ( "APP_ID is not set" ) ;
@@ -162,18 +162,13 @@ export class AgoraRTM2 extends IServiceTextChat {
162
162
token,
163
163
roomUUID,
164
164
ownerUUID,
165
- agoraAppId,
166
165
} : IServiceTextChatJoinRoomConfig ) : Promise < void > {
167
166
this . token = token || ( await generateRTMToken ( ) ) ;
168
167
169
168
if ( ! this . token ) {
170
169
throw new Error ( "Missing Agora RTM token" ) ;
171
170
}
172
171
173
- if ( agoraAppId && agoraAppId !== this . APP_ID ) {
174
- this . APP_ID = agoraAppId ;
175
- }
176
-
177
172
const client = ( this . client = new RTM ( this . APP_ID , uid , {
178
173
logLevel : "warn" ,
179
174
logUpload : ! process . env . DEV ,
You can’t perform that action at this time.
0 commit comments