@tencentcloud/tuiroom-engine-js 3.2.1 → 3.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +3 -0
- package/{index.d.ts → dist/index.d.ts} +2 -1
- package/dist/index.esm.js +3 -0
- package/dist/index.js +3 -0
- package/dist/src/error/error-info.d.ts +51 -0
- package/dist/src/error/tui-error.d.ts +10 -0
- package/dist/src/index.d.ts +1502 -0
- package/dist/src/modules/conferenceInvitationManager.d.ts +163 -0
- package/dist/src/modules/conferenceListManager.d.ts +244 -0
- package/dist/src/modules/deviceManager.d.ts +162 -0
- package/dist/src/modules/liveConnectionManager.d.ts +109 -0
- package/dist/src/modules/liveLayoutManager.d.ts +98 -0
- package/dist/src/modules/liveListManager.d.ts +120 -0
- package/dist/src/types.d.ts +1356 -0
- package/dist/src/utils/apiCallQueue.d.ts +18 -0
- package/dist/src/utils/common.d.ts +10 -0
- package/dist/src/utils/constant.d.ts +13 -0
- package/dist/src/utils/environment.d.ts +2 -0
- package/dist/src/utils/logger.d.ts +21 -0
- package/dist/src/utils/utils.d.ts +35 -0
- package/dist/src/utils/validate-config.d.ts +722 -0
- package/dist/src/utils/validate.d.ts +69 -0
- package/package.json +55 -17
- package/index.cjs.js +0 -1
- package/index.esm.js +0 -1
- package/index.js +0 -1
|
@@ -0,0 +1,1356 @@
|
|
|
1
|
+
export declare enum TUIErrorCode {
|
|
2
|
+
ERR_SUCC = 0,
|
|
3
|
+
ERR_FAILED = -1,
|
|
4
|
+
ERR_FREQ_LIMIT = -2,
|
|
5
|
+
ERR_REPEAT_OPERATION = -3,
|
|
6
|
+
ERR_SDKAPPID_NOT_FOUND = -1000,
|
|
7
|
+
ERR_INVALID_PARAMETER = -1001,
|
|
8
|
+
ERR_SDK_NOT_INITIALIZED = -1002,
|
|
9
|
+
ERR_PERMISSION_DENIED = -1003,
|
|
10
|
+
ERR_REQUIRE_PAYMENT = -1004,
|
|
11
|
+
ERR_CAMERA_START_FAILED = -1100,
|
|
12
|
+
ERR_CAMERA_NOT_AUTHORIZED = -1101,
|
|
13
|
+
ERR_CAMERA_OCCUPIED = -1102,
|
|
14
|
+
ERR_CAMERA_DEVICE_EMPTY = -1103,
|
|
15
|
+
ERR_MICROPHONE_START_FAILED = -1104,
|
|
16
|
+
ERR_MICROPHONE_NOT_AUTHORIZED = -1105,
|
|
17
|
+
ERR_MICROPHONE_OCCUPIED = -1106,
|
|
18
|
+
ERR_MICROPHONE_DEVICE_EMPTY = -1107,
|
|
19
|
+
ERR_GET_SCREEN_SHARING_TARGET_FAILED = -1108,
|
|
20
|
+
ERR_START_SCREEN_SHARING_FAILED = -1109,
|
|
21
|
+
ERR_ALREADY_ROOM_OWNER = -1200,
|
|
22
|
+
ERR_IM_ATTRIBUTE_WRITE_CONFLICT = -1201,
|
|
23
|
+
ERR_ALREADY_ROOM_ENTER = -1202,
|
|
24
|
+
ERR_DESTROY_ROOM_NO_PERMISSION = -1203,
|
|
25
|
+
ERR_LIVE_REQUEST_SERVER_TIMEOUT = -1300,
|
|
26
|
+
ERR_LIVE_SERVER_PROCESS_FAILED = -1301,
|
|
27
|
+
ERR_LIVE_DISCONNECTED = -1302,
|
|
28
|
+
ERR_LIVE_NO_AVAILABLE_HEVC_DECODERS = -1303,
|
|
29
|
+
ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM = -2101,
|
|
30
|
+
ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER = -2102,
|
|
31
|
+
ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE = -2103,
|
|
32
|
+
ERR_ROOM_ID_INVALID = -2105,
|
|
33
|
+
ERR_ROOM_NAME_INVALID = -2107,
|
|
34
|
+
ERR_ALREADY_IN_OTHER_ROOM = -2108,
|
|
35
|
+
ERR_USER_NOT_EXIST = -2200,
|
|
36
|
+
ERR_NEED_OWNER_PERMISSION = -2300,
|
|
37
|
+
ERR_NEED_ADMIN_PERMISSION = -2301,
|
|
38
|
+
ERR_REQUEST_NO_PERMISSION = -2310,
|
|
39
|
+
ERR_REQUEST_ID_INVALID = -2311,
|
|
40
|
+
ERR_REQUEST_ID_REPEAT = -2312,
|
|
41
|
+
ERR_MAX_SEAT_COUNT_LIMIT = -2340,
|
|
42
|
+
ERR_SEAT_INDEX_NOT_EXIST = -2344,
|
|
43
|
+
ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK = -2360,
|
|
44
|
+
ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN = -2361,
|
|
45
|
+
ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK = -2370,
|
|
46
|
+
ERR_OPEN_CAMERA_NEED_PERMISSION_FROM_ADMIN = -2371,
|
|
47
|
+
ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK = -2372,
|
|
48
|
+
ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN = -2373,
|
|
49
|
+
ERR_SEND_MESSAGE_DISABLED_FOR_ALL = -2380,
|
|
50
|
+
ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT = -2381,
|
|
51
|
+
ERR_ROOM_ID_OCCUPIED = 100003,
|
|
52
|
+
ERR_ROOM_ID_NOT_EXIST = 100004,
|
|
53
|
+
ERR_USER_NOT_ENTERED = 100005,
|
|
54
|
+
ERR_NEED_PASSWORD = 100018,
|
|
55
|
+
ERR_WRONG_PASSWORD = 100019,
|
|
56
|
+
ERR_ROOM_USER_FULL = 100008,
|
|
57
|
+
ERR_REQUEST_CONFLICT = 100102,
|
|
58
|
+
ERR_SEAT_OCCUPIED = 100210,
|
|
59
|
+
ERR_ALREADY_IN_SEAT = 100203,
|
|
60
|
+
ERR_SEAT_LOCKED = 100200,
|
|
61
|
+
ERR_ALL_SEAT_OCCUPIED = 100205,
|
|
62
|
+
ERR_USER_NOT_IN_SEAT = 100206,
|
|
63
|
+
ERR_SEAT_NOT_SUPPORT_LINK_MIC = 100211,
|
|
64
|
+
ERR_ROOM_ALREADY_CONNECTED = 100401,
|
|
65
|
+
ERR_ROOM_CONNECTED_IN_OTHER = 100403,
|
|
66
|
+
ERR_MAX_CONNECTED_COUNT_LIMIT = 100404,
|
|
67
|
+
ERR_BATTLE_IN_RUNNING = 100419,
|
|
68
|
+
ERR_BATTLE_ID_NOT_EXIST = 100411,
|
|
69
|
+
ERR_ROOM_BATTLEID_IN_OTHER = 100415,
|
|
70
|
+
ERR_ROOM_METADATA_EXCEED_KEY_COUNT_LIMIT = 100500,
|
|
71
|
+
ERR_ROOM_METADATA_EXCEED_VALUE_SIZE_LIMIT = 100501
|
|
72
|
+
}
|
|
73
|
+
export type TUIRoomInfo = {
|
|
74
|
+
roomId: string;
|
|
75
|
+
roomName: string;
|
|
76
|
+
roomType: TUIRoomType;
|
|
77
|
+
isSeatEnabled: boolean;
|
|
78
|
+
seatMode: TUISeatMode;
|
|
79
|
+
password: string;
|
|
80
|
+
isMicrophoneDisableForAllUser: boolean;
|
|
81
|
+
isScreenShareDisableForAllUser: boolean;
|
|
82
|
+
isCameraDisableForAllUser: boolean;
|
|
83
|
+
isMessageDisableForAllUser: boolean;
|
|
84
|
+
maxSeatCount: number;
|
|
85
|
+
roomOwner: string;
|
|
86
|
+
ownerId: string;
|
|
87
|
+
ownerName: string;
|
|
88
|
+
ownerAvatarUrl: string;
|
|
89
|
+
createTime: number;
|
|
90
|
+
roomMemberCount: number;
|
|
91
|
+
};
|
|
92
|
+
export type TUIEnterRoomOptions = {
|
|
93
|
+
password?: string;
|
|
94
|
+
};
|
|
95
|
+
export type TUILoginUserInfo = {
|
|
96
|
+
userId: string;
|
|
97
|
+
userName: string;
|
|
98
|
+
avatarUrl: string;
|
|
99
|
+
customInfo: Record<string, any>;
|
|
100
|
+
};
|
|
101
|
+
export type TUISeatLockParams = {
|
|
102
|
+
lockSeat: boolean;
|
|
103
|
+
lockVideo: boolean;
|
|
104
|
+
lockAudio: boolean;
|
|
105
|
+
};
|
|
106
|
+
export declare enum TUIRole {
|
|
107
|
+
kRoomOwner = 0,
|
|
108
|
+
kAdministrator = 1,
|
|
109
|
+
kGeneralUser = 2
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 消息结构体
|
|
113
|
+
* @typedef {object} TUIMessage
|
|
114
|
+
* @property {string} messageId 消息 Id
|
|
115
|
+
* @property {string} message 消息内容
|
|
116
|
+
* @property {number} timestamp 时间戳信息, 精确到秒
|
|
117
|
+
* @property {TUIRole} userId 用户 Id
|
|
118
|
+
* @property {boolean} userName 用户名称
|
|
119
|
+
* @property {boolean} avatarUrl 用户头像地址
|
|
120
|
+
*/
|
|
121
|
+
export type TUIMessage = {
|
|
122
|
+
messageId: string;
|
|
123
|
+
message: string;
|
|
124
|
+
timestamp: number;
|
|
125
|
+
userId: string;
|
|
126
|
+
userName: string;
|
|
127
|
+
avatarUrl: string;
|
|
128
|
+
};
|
|
129
|
+
export declare enum TUIVideoQuality {
|
|
130
|
+
kVideoQuality_360p = 1,
|
|
131
|
+
kVideoQuality_540p = 2,
|
|
132
|
+
kVideoQuality_720p = 3,
|
|
133
|
+
kVideoQuality_1080p = 4
|
|
134
|
+
}
|
|
135
|
+
export declare enum TUIAudioQuality {
|
|
136
|
+
kAudioProfileSpeech = 0,
|
|
137
|
+
kAudioProfileDefault = 1,
|
|
138
|
+
kAudioProfileMusic = 2
|
|
139
|
+
}
|
|
140
|
+
export declare enum TUIVideoStreamType {
|
|
141
|
+
kCameraStream = 0,
|
|
142
|
+
kScreenStream = 1,
|
|
143
|
+
kCameraStreamLow = 2
|
|
144
|
+
}
|
|
145
|
+
export declare enum TUINetworkQuality {
|
|
146
|
+
kQualityUnknown = 0,
|
|
147
|
+
kQualityExcellent = 1,
|
|
148
|
+
kQualityGood = 2,
|
|
149
|
+
kQualityPoor = 3,
|
|
150
|
+
kQualityBad = 4,
|
|
151
|
+
kQualityVeryBad = 5,
|
|
152
|
+
kQualityDown = 6
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 消息结构体
|
|
156
|
+
* @typedef {object} TUINetwork
|
|
157
|
+
* @property {string} userId 用户 Id
|
|
158
|
+
* @property {TUINetworkQuality} quality 网络质量
|
|
159
|
+
* @property {number} upLoss 上行丢包率,单位 (%) 该数值越小越好,目前仅本地用户有该信息
|
|
160
|
+
* @property {TUIRole} downLoss 下行丢包率,单位 (%) 该数值越小越好,目前仅本地用户有该信息
|
|
161
|
+
* @property {Number} delay 网络延迟,单位 ms,目前仅本地用户有该信息
|
|
162
|
+
*/
|
|
163
|
+
export type TUINetwork = {
|
|
164
|
+
userId: string;
|
|
165
|
+
quality: TUINetworkQuality;
|
|
166
|
+
upLoss: number;
|
|
167
|
+
downLoss: number;
|
|
168
|
+
delay: number;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* 视频编码参数
|
|
172
|
+
* @typedef {object} TUIVideoEncoderParams
|
|
173
|
+
* @property {number} fps 帧率设置
|
|
174
|
+
* @property {number} bitrate 目标编码码率设置
|
|
175
|
+
* @property {TUIVideoQuality} quality 上行视频分辨率
|
|
176
|
+
* @property {TUIVideoQuality} videoResolution 上行视频分辨率(自 v1.6.0 版本开始支持,v1.6.0 之前版本请使用 quality 参数)
|
|
177
|
+
* @property {TUIResolutionMode} resolutionMode 横竖屏模式
|
|
178
|
+
*/
|
|
179
|
+
export type TUIVideoEncoderParams = {
|
|
180
|
+
quality?: TUIVideoQuality;
|
|
181
|
+
videoResolution: TUIVideoQuality;
|
|
182
|
+
fps: number;
|
|
183
|
+
bitrate: number;
|
|
184
|
+
resolutionMode: TUIResolutionMode;
|
|
185
|
+
};
|
|
186
|
+
export declare enum TUIRoomType {
|
|
187
|
+
kConference = 1,
|
|
188
|
+
kLive = 2
|
|
189
|
+
}
|
|
190
|
+
export declare enum TUISeatMode {
|
|
191
|
+
kFreeToTake = 1,
|
|
192
|
+
kApplyToTake = 2
|
|
193
|
+
}
|
|
194
|
+
export declare enum TUIMediaDevice {
|
|
195
|
+
kMicrophone = 1,
|
|
196
|
+
kCamera = 2,
|
|
197
|
+
kScreen = 3
|
|
198
|
+
}
|
|
199
|
+
export declare enum TUICaptureSourceType {
|
|
200
|
+
kWindow = 0,
|
|
201
|
+
kScreen = 1
|
|
202
|
+
}
|
|
203
|
+
export declare enum TUIChangeReason {
|
|
204
|
+
kChangedBySelf = 0,
|
|
205
|
+
kChangedByAdmin = 1
|
|
206
|
+
}
|
|
207
|
+
export declare enum TUIKickedOutOfRoomReason {
|
|
208
|
+
kKickedByAdmin = 0,
|
|
209
|
+
kKickedByLoggedOnOtherDevice = 1,
|
|
210
|
+
kKickedByServer = 2,
|
|
211
|
+
kNetworkDisconnected = 3,
|
|
212
|
+
kJoinRoomStatusInvalidDuringOffline = 4,
|
|
213
|
+
kCountOfJoinedRoomsExceedLimit = 5
|
|
214
|
+
}
|
|
215
|
+
export declare enum TUIRequestAction {
|
|
216
|
+
kInvalidAction = 0,
|
|
217
|
+
kRequestToOpenRemoteCamera = 1,
|
|
218
|
+
kRequestToOpenRemoteMicrophone = 2,
|
|
219
|
+
kRequestToConnectOtherRoom = 3,
|
|
220
|
+
kRequestToTakeSeat = 4,
|
|
221
|
+
kRequestRemoteUserOnSeat = 5,
|
|
222
|
+
kApplyToAdminToOpenLocalCamera = 6,
|
|
223
|
+
kApplyToAdminToOpenLocalMicrophone = 7,
|
|
224
|
+
kApplyToAdminToOpenLocalScreenShare = 8
|
|
225
|
+
}
|
|
226
|
+
export declare enum TUIRequestCallbackType {
|
|
227
|
+
kRequestAccepted = 0,
|
|
228
|
+
kRequestRejected = 1,
|
|
229
|
+
kRequestCancelled = 2,
|
|
230
|
+
kRequestTimeout = 3,
|
|
231
|
+
kRequestError = 4
|
|
232
|
+
}
|
|
233
|
+
export declare enum TRTCRole {
|
|
234
|
+
kAnchor = 0,
|
|
235
|
+
kAudience = 1
|
|
236
|
+
}
|
|
237
|
+
export declare enum TUIResolutionMode {
|
|
238
|
+
kResolutionMode_Landscape = 0,
|
|
239
|
+
kResolutionMode_Portrait = 1
|
|
240
|
+
}
|
|
241
|
+
export declare enum TUIRoomDismissedReason {
|
|
242
|
+
kByOwner = 1,
|
|
243
|
+
kByServer = 2
|
|
244
|
+
}
|
|
245
|
+
export type TUIUserInfo = {
|
|
246
|
+
userId: string;
|
|
247
|
+
userName: string;
|
|
248
|
+
nameCard: string;
|
|
249
|
+
avatarUrl: string;
|
|
250
|
+
userRole: TUIRole;
|
|
251
|
+
hasAudioStream: boolean;
|
|
252
|
+
hasVideoStream: boolean;
|
|
253
|
+
hasScreenStream: boolean;
|
|
254
|
+
isMessageDisabled: boolean;
|
|
255
|
+
roomCustomInfo: Record<string, any>;
|
|
256
|
+
};
|
|
257
|
+
export type TUISeatInfo = {
|
|
258
|
+
index: number;
|
|
259
|
+
userId: string;
|
|
260
|
+
userName: string;
|
|
261
|
+
nameCard: string;
|
|
262
|
+
avatarUrl: string;
|
|
263
|
+
isLocked: boolean;
|
|
264
|
+
isVideoLocked: boolean;
|
|
265
|
+
isAudioLocked: boolean;
|
|
266
|
+
};
|
|
267
|
+
export type TUIRequest = {
|
|
268
|
+
requestAction: TUIRequestAction;
|
|
269
|
+
timestamp: number;
|
|
270
|
+
requestId: string;
|
|
271
|
+
userId: string;
|
|
272
|
+
userName: string;
|
|
273
|
+
nameCard: string;
|
|
274
|
+
avatarUrl: string;
|
|
275
|
+
content: string;
|
|
276
|
+
};
|
|
277
|
+
export type TUIRequestCallback = {
|
|
278
|
+
requestCallbackType: TUIRequestCallbackType;
|
|
279
|
+
requestId: string;
|
|
280
|
+
userId: string;
|
|
281
|
+
code: number;
|
|
282
|
+
message: string;
|
|
283
|
+
};
|
|
284
|
+
export declare enum TUIMediaDeviceType {
|
|
285
|
+
kMediaDeviceTypeUnknown = -1,
|
|
286
|
+
kMediaDeviceTypeAudioInput = 0,
|
|
287
|
+
kMediaDeviceTypeAudioOutput = 1,
|
|
288
|
+
kMediaDeviceTypeVideoCamera = 2
|
|
289
|
+
}
|
|
290
|
+
export declare enum TUIMediaDeviceState {
|
|
291
|
+
kMediaDeviceStateAdd = 0,
|
|
292
|
+
kMediaDeviceStateRemove = 1,
|
|
293
|
+
kMediaDeviceStateActive = 2
|
|
294
|
+
}
|
|
295
|
+
export declare enum TUIAudioRoute {
|
|
296
|
+
kAudioRouteSpeakerphone = 0,
|
|
297
|
+
kAudioRouteEarpiece = 1
|
|
298
|
+
}
|
|
299
|
+
export type TUIDeviceInfo = {
|
|
300
|
+
deviceId: string;
|
|
301
|
+
deviceName: string;
|
|
302
|
+
deviceProperties?: {
|
|
303
|
+
supportedResolution?: {
|
|
304
|
+
width: number;
|
|
305
|
+
height: number;
|
|
306
|
+
}[];
|
|
307
|
+
};
|
|
308
|
+
};
|
|
309
|
+
export declare enum TUIConferenceStatus {
|
|
310
|
+
kConferenceStatusNone = 0,
|
|
311
|
+
kConferenceStatusNotStarted = 1,
|
|
312
|
+
kConferenceStatusRunning = 2
|
|
313
|
+
}
|
|
314
|
+
export declare enum TUIConferenceCancelReason {
|
|
315
|
+
kConferenceCancelReasonCancelledByAdmin = 0,
|
|
316
|
+
kConferenceCancelReasonRemovedFromAttendees = 1
|
|
317
|
+
}
|
|
318
|
+
export type TUIConferenceInfo = {
|
|
319
|
+
scheduleStartTime: number;
|
|
320
|
+
scheduleEndTime: number;
|
|
321
|
+
scheduleAttendees: string[];
|
|
322
|
+
reminderSecondsBeforeStart: number;
|
|
323
|
+
status: TUIConferenceStatus;
|
|
324
|
+
basicRoomInfo: TUIRoomInfo;
|
|
325
|
+
};
|
|
326
|
+
export type TUIConferenceModifyInfo = {
|
|
327
|
+
scheduleStartTime?: number;
|
|
328
|
+
scheduleEndTime?: number;
|
|
329
|
+
basicRoomInfo: {
|
|
330
|
+
roomId: string;
|
|
331
|
+
roomName?: string;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* 自动播放失败时回调参数结构体
|
|
336
|
+
*
|
|
337
|
+
* userId 用户ID
|
|
338
|
+
* resume 恢复播放的回调函数
|
|
339
|
+
*/
|
|
340
|
+
export type TUIAutoPlayCallbackInfo = {
|
|
341
|
+
userId: string;
|
|
342
|
+
resume: () => void;
|
|
343
|
+
};
|
|
344
|
+
export declare enum TUIInvitationStatus {
|
|
345
|
+
kNone = 0,
|
|
346
|
+
kPending = 1,
|
|
347
|
+
kTimeout = 2,
|
|
348
|
+
kAccepted = 3,
|
|
349
|
+
kRejected = 4
|
|
350
|
+
}
|
|
351
|
+
export declare enum TUIInvitationCode {
|
|
352
|
+
kSuccess = 0,
|
|
353
|
+
kAlreadyInInvitationList = 1,
|
|
354
|
+
kAlreadyInConference = 2
|
|
355
|
+
}
|
|
356
|
+
export declare enum TUIInvitationRejectedReason {
|
|
357
|
+
kRejectToEnter = 0,
|
|
358
|
+
kInOtherConference = 1
|
|
359
|
+
}
|
|
360
|
+
export type TUIInvitation = {
|
|
361
|
+
status: TUIInvitationStatus;
|
|
362
|
+
invitee: TUIUserInfo;
|
|
363
|
+
inviter: TUIUserInfo;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* **TUIRoomEngine 事件列表**<br>
|
|
367
|
+
* @namespace TUIRoomEvents
|
|
368
|
+
* @example
|
|
369
|
+
* import TUIRoomEngine, { TUIRoomEvents } from '@tencentcloud/tuiroom-engine-js';
|
|
370
|
+
* const roomEngine = new TUIRoomEngine();
|
|
371
|
+
* roomEngine.on(TUIRoomEvents.onError, (error) => {
|
|
372
|
+
* console.log('roomEngine.error', error);
|
|
373
|
+
* })
|
|
374
|
+
*/
|
|
375
|
+
export declare enum TUIRoomEvents {
|
|
376
|
+
/**
|
|
377
|
+
*
|
|
378
|
+
* @description 错误事件
|
|
379
|
+
* @event TUIRoomEvents#onError
|
|
380
|
+
* @param {object} options
|
|
381
|
+
* @param {number} options.code 错误代码
|
|
382
|
+
* @param {string} options.message 错误信息
|
|
383
|
+
* @example
|
|
384
|
+
* const roomEngine = new TUIRoomEngine();
|
|
385
|
+
* roomEngine.on(TUIRoomEvents.onError, (error) => {
|
|
386
|
+
* console.log('TUIRoomError error', error);
|
|
387
|
+
* })
|
|
388
|
+
*/
|
|
389
|
+
onError = "onError",
|
|
390
|
+
/**
|
|
391
|
+
* @description 踢出房间事件
|
|
392
|
+
* @default 'onKickedOutOfRoom'
|
|
393
|
+
* @event TUIRoomEvents#onKickedOutOfRoom
|
|
394
|
+
* @param {object} options
|
|
395
|
+
* @param {string} options.roomId 房间号
|
|
396
|
+
* @param {TUIKickedOutOfRoomReason} options.reason 用户被踢出房间枚举
|
|
397
|
+
* @param {string} options.message 踢出房间信息
|
|
398
|
+
* @example
|
|
399
|
+
* const roomEngine = new TUIRoomEngine();
|
|
400
|
+
* roomEngine.on(TUIRoomEvents.onKickedOutOfRoom, ({ roomId, reason, message }) => {
|
|
401
|
+
* console.log('roomEngine.onKickedOutOfRoom', roomId, reason, message);
|
|
402
|
+
* });
|
|
403
|
+
*/
|
|
404
|
+
onKickedOutOfRoom = "onKickedOutOfRoom",
|
|
405
|
+
/**
|
|
406
|
+
* @description 当前用户被踢下线
|
|
407
|
+
* @default 'onKickedOffLine'
|
|
408
|
+
* @event TUIRoomEvents#onKickedOffLine
|
|
409
|
+
* @param {string} options.message 用户被踢下线信息
|
|
410
|
+
* @example
|
|
411
|
+
* const roomEngine = new TUIRoomEngine();
|
|
412
|
+
* roomEngine.on(TUIRoomEvents.onKickedOffLine, ({ message }) => {
|
|
413
|
+
* console.log('roomEngine.onKickedOffLine', message);
|
|
414
|
+
* });
|
|
415
|
+
*/
|
|
416
|
+
onKickedOffLine = "onKickedOffLine",
|
|
417
|
+
/**
|
|
418
|
+
* @description userSig 过期事件
|
|
419
|
+
* @default 'onUserSigExpired'
|
|
420
|
+
* @event TUIRoomEvents#onUserSigExpired
|
|
421
|
+
* @example
|
|
422
|
+
* const roomEngine = new TUIRoomEngine();
|
|
423
|
+
* roomEngine.on(TUIRoomEvents.onUserSigExpired, () => {
|
|
424
|
+
* console.log('roomEngine.onUserSigExpired');
|
|
425
|
+
* });
|
|
426
|
+
*/
|
|
427
|
+
onUserSigExpired = "onUserSigExpired",
|
|
428
|
+
/**
|
|
429
|
+
* @description 主持人销毁房间事件
|
|
430
|
+
* @default 'onRoomDismissed'
|
|
431
|
+
* @event TUIRoomEvents#onRoomDismissed
|
|
432
|
+
* @param {object} options
|
|
433
|
+
* @param {string} options.roomId 房间号
|
|
434
|
+
* @param {TUIRoomDismissedReason} options.reason 房间解散原因枚举,该字段自 v2.3.0 开始支持
|
|
435
|
+
* @example
|
|
436
|
+
* const roomEngine = new TUIRoomEngine();
|
|
437
|
+
* roomEngine.on(TUIRoomEvents.onRoomDismissed, ({ roomId,reason }) => {
|
|
438
|
+
* console.log('roomEngine.onRoomDismissed', roomId,reason);
|
|
439
|
+
* });
|
|
440
|
+
*/
|
|
441
|
+
onRoomDismissed = "onRoomDismissed",
|
|
442
|
+
/**
|
|
443
|
+
* @description 房间名字修改事件
|
|
444
|
+
* @default 'onRoomNameChanged'
|
|
445
|
+
* @event TUIRoomEvents#onRoomChanged
|
|
446
|
+
* @param {object} options
|
|
447
|
+
* @param {string} options.roomName 房间名字
|
|
448
|
+
* @example
|
|
449
|
+
* const roomEngine = new TUIRoomEngine();
|
|
450
|
+
* roomEngine.on(TUIRoomEvents.onRoomNameChanged, ({ roomId, roomName }) =>{
|
|
451
|
+
* console.log('roomEngine.onRoomNameChanged', roomId, roomName);
|
|
452
|
+
* });
|
|
453
|
+
*/
|
|
454
|
+
onRoomNameChanged = "onRoomNameChanged",
|
|
455
|
+
/**
|
|
456
|
+
* @description 上麦模式修改事件
|
|
457
|
+
* @default 'onRoomSeatModeChanged'
|
|
458
|
+
* @event TUIRoomEvents#onRoomSeatModeChanged
|
|
459
|
+
* @param {object} options
|
|
460
|
+
* @param {TUISeatMode} options.seatMode 房间上麦模式
|
|
461
|
+
* @example
|
|
462
|
+
* const roomEngine = new TUIRoomEngine();
|
|
463
|
+
* roomEngine.on(TUIRoomEvents.onRoomSeatModeChanged, ({ roomId, seatMode }) =>{
|
|
464
|
+
* console.log('roomEngine.onRoomSeatModeChanged', roomId, seatMode);
|
|
465
|
+
* });
|
|
466
|
+
*/
|
|
467
|
+
onRoomSeatModeChanged = "onRoomSeatModeChanged",
|
|
468
|
+
/**
|
|
469
|
+
* @description 房间内人数变化事件
|
|
470
|
+
* @default 'onRoomUserCountChanged'
|
|
471
|
+
* @event TUIRoomEvents#onRoomUserCountChanged
|
|
472
|
+
* @param {object} options
|
|
473
|
+
* @param {string} options.roomId 房间号
|
|
474
|
+
* @param {number} options.userCount 房间内人数
|
|
475
|
+
* @example
|
|
476
|
+
* const roomEngine = new TUIRoomEngine();
|
|
477
|
+
* roomEngine.on(TUIRoomEvents.onRoomUserCountChanged, ({ roomId, userCount }) =>{
|
|
478
|
+
* console.log('roomEngine.onRoomUserCountChanged', roomId, userCount);
|
|
479
|
+
* });
|
|
480
|
+
*/
|
|
481
|
+
onRoomUserCountChanged = "onRoomUserCountChanged",
|
|
482
|
+
/**
|
|
483
|
+
* @description 所有成员摄像头使用权限改变事件
|
|
484
|
+
* @default 'onAllUserCameraDisableChanged'
|
|
485
|
+
* @event TUIRoomEvents#onAllUserCameraDisableChanged
|
|
486
|
+
* @param {object} options
|
|
487
|
+
* @param {boolean} options.isDisable 是否允许使用摄像头
|
|
488
|
+
* @example
|
|
489
|
+
* const roomEngine = new TUIRoomEngine();
|
|
490
|
+
* roomEngine.on(TUIRoomEvents.onAllUserCameraDisableChanged, ({ isDisable }) =>{
|
|
491
|
+
* console.log('roomEngine.onAllUserCameraDisableChanged', isDisable);
|
|
492
|
+
* });
|
|
493
|
+
*/
|
|
494
|
+
onAllUserCameraDisableChanged = "onAllUserCameraDisableChanged",
|
|
495
|
+
/**
|
|
496
|
+
* @since v2.2.0
|
|
497
|
+
* @description 房间内所有用户屏幕分享被禁用事件
|
|
498
|
+
* @default 'onScreenShareForAllUserDisableChanged'
|
|
499
|
+
* @event TUIRoomEvents#onScreenShareForAllUserDisableChanged
|
|
500
|
+
* @param {object} options
|
|
501
|
+
* @param {boolean} options.isDisable 是否开启禁止屏幕分享
|
|
502
|
+
* @example
|
|
503
|
+
* const roomEngine = new TUIRoomEngine();
|
|
504
|
+
* roomEngine.on(TUIRoomEvents.onScreenShareForAllUserDisableChanged, ({ isDisable }) =>{
|
|
505
|
+
* console.log('roomEngine.onScreenShareForAllUserDisableChanged', isDisable);
|
|
506
|
+
* });
|
|
507
|
+
*/
|
|
508
|
+
onScreenShareForAllUserDisableChanged = "onScreenShareForAllUserDisableChanged",
|
|
509
|
+
/**
|
|
510
|
+
* @description 所有成员麦克风使用权限改变事件
|
|
511
|
+
* @default 'onAllUserMicrophoneDisableChanged'
|
|
512
|
+
* @event TUIRoomEvents#onAllUserMicrophoneDisableChanged
|
|
513
|
+
* @param {object} options
|
|
514
|
+
* @param {boolean} options.isDisable 是否允许使用麦克风
|
|
515
|
+
* @example
|
|
516
|
+
* const roomEngine = new TUIRoomEngine();
|
|
517
|
+
* roomEngine.on(TUIRoomEvents.onAllUserMicrophoneDisableChanged, ({ isDisable }) =>{
|
|
518
|
+
* console.log('roomEngine.onAllUserMicrophoneDisableChanged', isDisable);
|
|
519
|
+
* });
|
|
520
|
+
*/
|
|
521
|
+
onAllUserMicrophoneDisableChanged = "onAllUserMicrophoneDisableChanged",
|
|
522
|
+
/**
|
|
523
|
+
* @description 所有成员发送消息权限改变事件
|
|
524
|
+
* @default 'onSendMessageForAllUserDisableChanged'
|
|
525
|
+
* @event TUIRoomEvents#OnSendMessageForAllUserDisableChanged
|
|
526
|
+
* @param {object} options
|
|
527
|
+
* @param {boolean} options.isDisable 是否被允许
|
|
528
|
+
* @example
|
|
529
|
+
* const roomEngine = new TUIRoomEngine();
|
|
530
|
+
* roomEngine.on(TUIRoomEvents.onSendMessageForAllUserDisableChanged, ({ isDisable }) =>{
|
|
531
|
+
* console.log('roomEngine.onSendMessageForAllUserDisableChanged', isDisable);
|
|
532
|
+
* });
|
|
533
|
+
*/
|
|
534
|
+
onSendMessageForAllUserDisableChanged = "onSendMessageForAllUserDisableChanged",
|
|
535
|
+
/**
|
|
536
|
+
* @description 房间最大麦位数修改事件
|
|
537
|
+
* @default 'onRoomMaxSeatCountChanged'
|
|
538
|
+
* @event TUIRoomEvents#onRoomMaxSeatCountChanged
|
|
539
|
+
* @param {object} options
|
|
540
|
+
* @param {boolean} options.maxSeatNumber 最大麦位数
|
|
541
|
+
* @example
|
|
542
|
+
* const roomEngine = new TUIRoomEngine();
|
|
543
|
+
* roomEngine.on(TUIRoomEvents.onRoomMaxSeatCountChanged, ({ maxSeatNumber }) =>{
|
|
544
|
+
* console.log('roomEngine.onRoomMaxSeatCountChanged', maxSeatNumber);
|
|
545
|
+
* });
|
|
546
|
+
*/
|
|
547
|
+
onRoomMaxSeatCountChanged = "onRoomMaxSeatCountChanged",
|
|
548
|
+
/**
|
|
549
|
+
* @description 远端用户进入房间事件
|
|
550
|
+
* @default 'onRemoteUserEnterRoom'
|
|
551
|
+
* @event TUIRoomEvents#onRemoteUserEnterRoom
|
|
552
|
+
* @param {object} options
|
|
553
|
+
* @param {string} options.roomId 房间号
|
|
554
|
+
* @param {TUIUserInfo} options.userInfo 用户信息
|
|
555
|
+
* @example
|
|
556
|
+
* const roomEngine = new TUIRoomEngine();
|
|
557
|
+
* roomEngine.on(TUIRoomEvents.onRemoteUserEnterRoom, ({ roomId, userInfo }) => {
|
|
558
|
+
* console.log('roomEngine.onRemoteUserEnterRoom', roomId, userInfo);
|
|
559
|
+
* });
|
|
560
|
+
*/
|
|
561
|
+
onRemoteUserEnterRoom = "onRemoteUserEnterRoom",
|
|
562
|
+
/**
|
|
563
|
+
* @description 远端用户离开房间事件
|
|
564
|
+
* @default 'onRemoteUserLeaveRoom'
|
|
565
|
+
* @event TUIRoomEvents#onRemoteUserLeaveRoom
|
|
566
|
+
* @param {object} options
|
|
567
|
+
* @param {string} options.roomId 房间号
|
|
568
|
+
* @param {TUIUserInfo} options.userInfo 用户信息
|
|
569
|
+
* @example
|
|
570
|
+
* const roomEngine = new TUIRoomEngine();
|
|
571
|
+
* roomEngine.on(TUIRoomEvents.onRemoteUserLeaveRoom, ({ roomId, userInfo }) => {
|
|
572
|
+
* console.log('roomEngine.onRemoteUserLeaveRoom', roomId, userInfo);
|
|
573
|
+
* });
|
|
574
|
+
*/
|
|
575
|
+
onRemoteUserLeaveRoom = "onRemoteUserLeaveRoom",
|
|
576
|
+
/**
|
|
577
|
+
* @since v2.5.0
|
|
578
|
+
* @description 房间内用户信息改变事件
|
|
579
|
+
* @default 'onUserInfoChanged'
|
|
580
|
+
* @event TUIRoomEvents#onUserInfoChanged
|
|
581
|
+
* @param {object} options
|
|
582
|
+
* @param {TUIUserInfo} options.userInfo 用户信息
|
|
583
|
+
* @example
|
|
584
|
+
* const roomEngine = new TUIRoomEngine();
|
|
585
|
+
* roomEngine.on(TUIRoomEvents.onUserInfoChanged, ({ userInfo }) => {
|
|
586
|
+
* console.log('roomEngine.onUserInfoChanged', userInfo);
|
|
587
|
+
* });
|
|
588
|
+
*/
|
|
589
|
+
onUserInfoChanged = "onUserInfoChanged",
|
|
590
|
+
/**
|
|
591
|
+
* @description 用户角色改变事件
|
|
592
|
+
* @deprecated 该接口自 v2.5.0 版本废弃,请使用'onUserInfoChanged'.
|
|
593
|
+
* @default 'onUserRoleChanged'
|
|
594
|
+
* @event TUIRoomEvents#onUserRoleChanged
|
|
595
|
+
* @param {object} options
|
|
596
|
+
* @param {string} options.userId 用户Id
|
|
597
|
+
* @param {TUIRole} options.userRole 用户变更后的角色
|
|
598
|
+
* @param {TUIUserInfo} options.userInfo 用户信息,该字段自 v2.3.0 开始支持
|
|
599
|
+
* @example
|
|
600
|
+
* const roomEngine = new TUIRoomEngine();
|
|
601
|
+
* roomEngine.on(TUIRoomEvents.onUserRoleChanged, ({ userInfo }) => {
|
|
602
|
+
* console.log('roomEngine.onUserRoleChanged', userInfo);
|
|
603
|
+
* });
|
|
604
|
+
*/
|
|
605
|
+
onUserRoleChanged = "onUserRoleChanged",
|
|
606
|
+
/**
|
|
607
|
+
* @description 用户视频状态改变事件
|
|
608
|
+
* @default 'onUserVideoStateChanged'
|
|
609
|
+
* @event TUIRoomEvents#onUserVideoStateChanged
|
|
610
|
+
* @param {object} options
|
|
611
|
+
* @param {string} options.userId 用户Id
|
|
612
|
+
* @param {TUIVideoStreamType} options.streamType 用户流类型
|
|
613
|
+
* @param {boolean} options.hasVideo 是否有视频流
|
|
614
|
+
* @param {TUIChangeReason} options.reason 变更原因
|
|
615
|
+
* @example
|
|
616
|
+
* const roomEngine = new TUIRoomEngine();
|
|
617
|
+
* roomEngine.on(TUIRoomEvents.onUserVideoStateChanged, ({ userId, streamType, hasVideo, reason }) => {
|
|
618
|
+
* console.log('roomEngine.onUserVideoStateChanged', userId, streamType, hasVideo, reason);
|
|
619
|
+
* });
|
|
620
|
+
*/
|
|
621
|
+
onUserVideoStateChanged = "onUserVideoStateChanged",
|
|
622
|
+
/**
|
|
623
|
+
* @description 用户音频状态改变事件
|
|
624
|
+
* @default 'onUserAudioStateChanged'
|
|
625
|
+
* @event TUIRoomEvents#onUserAudioStateChanged
|
|
626
|
+
* @param {object} options
|
|
627
|
+
* @param {string} options.userId 用户Id
|
|
628
|
+
* @param {boolean} options.hasVideo 是否有音频流
|
|
629
|
+
* @param {TUIChangeReason} options.reason 原因
|
|
630
|
+
* @example
|
|
631
|
+
* const roomEngine = new TUIRoomEngine();
|
|
632
|
+
* roomEngine.on(TUIRoomEvents.onUserAudioStateChanged, ({ userId, hasAudio, reason }) => {
|
|
633
|
+
* console.log('roomEngine.onUserAudioStateChanged', userId, hasAudio, reason);
|
|
634
|
+
* });
|
|
635
|
+
*/
|
|
636
|
+
onUserAudioStateChanged = "onUserAudioStateChanged",
|
|
637
|
+
/**
|
|
638
|
+
* @description 用户发送消息状态改变事件
|
|
639
|
+
* @default 'onSendMessageForUserDisableChanged'
|
|
640
|
+
* @event TUIRoomEvents#onSendMessageForUserDisableChanged
|
|
641
|
+
* @param {object} options
|
|
642
|
+
* @param {string} options.userId 成员 Id
|
|
643
|
+
* @param {boolean} options.isDisable 是否被允许
|
|
644
|
+
* @example
|
|
645
|
+
* const roomEngine = new TUIRoomEngine();
|
|
646
|
+
* roomEngine.on(TUIRoomEvents.onSendMessageForUserDisableChanged, ({ userId, isDisable }) =>{
|
|
647
|
+
* console.log('roomEngine.onSendMessageForUserDisableChanged', isDisable);
|
|
648
|
+
* });
|
|
649
|
+
*/
|
|
650
|
+
onSendMessageForUserDisableChanged = "onSendMessageForUserDisableChanged",
|
|
651
|
+
/**
|
|
652
|
+
* @description 用户音量改变事件
|
|
653
|
+
* @default 'onUserVoiceVolumeChanged'
|
|
654
|
+
* @event TUIRoomEvents#onUserVoiceVolumeChanged
|
|
655
|
+
* @param {object} options
|
|
656
|
+
* @param {Array<TRTCVolumeInfo>} options.userVolumeList 房间内所有用户的音量, 包含 userId 及 volume 信息,volume 区间为 1~100;
|
|
657
|
+
* @example
|
|
658
|
+
* const roomEngine = new TUIRoomEngine();
|
|
659
|
+
* roomEngine.on(TUIRoomEvents.onUserVoiceVolumeChanged, ({ userVolumeList }) => {
|
|
660
|
+
* userVolumeList.forEach(userVolume => {
|
|
661
|
+
* console.log('roomEngine.onUserVoiceVolumeChanged', userVolume.userId, userVolume.volume);
|
|
662
|
+
* })
|
|
663
|
+
* });
|
|
664
|
+
*/
|
|
665
|
+
onUserVoiceVolumeChanged = "onUserVoiceVolumeChanged",
|
|
666
|
+
/**
|
|
667
|
+
* @description 用户网络质量改变事件
|
|
668
|
+
* @default 'onUserNetworkQualityChanged'
|
|
669
|
+
* @event TUIRoomEvents#onUserNetworkQualityChanged
|
|
670
|
+
* @param {object} options
|
|
671
|
+
* @param {TUINetwork} options.userNetworkList 网络质量信息
|
|
672
|
+
* @example
|
|
673
|
+
* const roomEngine = new TUIRoomEngine();
|
|
674
|
+
* roomEngine.on(TUIRoomEvents.onUserNetworkQualityChanged, ({ userNetworkList }) => {
|
|
675
|
+
* userNetworkList.forEach(userNetwork => {
|
|
676
|
+
* console.log('roomEngine.onUserNetworkQualityChanged',
|
|
677
|
+
* userNetwork.userId, userNetwork.quality, userNetwork.upLoss, userNetwork.downLoss, userNetwork.delay);
|
|
678
|
+
* })
|
|
679
|
+
* });
|
|
680
|
+
*/
|
|
681
|
+
onUserNetworkQualityChanged = "onUserNetworkQualityChanged",
|
|
682
|
+
/**
|
|
683
|
+
* @description 麦位列表改变事件
|
|
684
|
+
* @default 'onSeatListChanged'
|
|
685
|
+
* @event TUIRoomEvents#onSeatListChanged
|
|
686
|
+
* @param {object} options
|
|
687
|
+
* @param {Array<TUISeatInfo>} options.seatList 麦位列表
|
|
688
|
+
* @param {Array<TUISeatInfo>} options.seatedList 新增麦位列表
|
|
689
|
+
* @param {Array<TUISeatInfo>} options.leftList 离开的麦位列表
|
|
690
|
+
* @example
|
|
691
|
+
* const roomEngine = new TUIRoomEngine();
|
|
692
|
+
* roomEngine.on(TUIRoomEvents.onSeatListChanged, ({ seatList, seatedList, leftList }) => {
|
|
693
|
+
* console.log('roomEngine.onSeatListChanged',seatList, seatedList, leftList);
|
|
694
|
+
* });
|
|
695
|
+
*/
|
|
696
|
+
onSeatListChanged = "onSeatListChanged",
|
|
697
|
+
/**
|
|
698
|
+
* @description 当前用户被踢下麦事件
|
|
699
|
+
* @default 'onKickedOffSeat'
|
|
700
|
+
* @event TUIRoomEvents#onKickedOffSeat
|
|
701
|
+
* @param {number} options.seatIndex 麦位编号,该字段自 v2.3.0 开始支持
|
|
702
|
+
* @param {TUIUserInfo} options.userInfo 操作踢人的(主持人/管理员)用户信息,该字段自 v2.3.0 开始支持
|
|
703
|
+
* @example
|
|
704
|
+
* const roomEngine = new TUIRoomEngine();
|
|
705
|
+
* roomEngine.on(TUIRoomEvents.onKickedOffSeat, ({ seatIndex, userInfo }) => {
|
|
706
|
+
* console.log('roomEngine.onKickedOffSeat', seatIndex, userInfo);
|
|
707
|
+
* });
|
|
708
|
+
*/
|
|
709
|
+
onKickedOffSeat = "onKickedOffSeat",
|
|
710
|
+
/**
|
|
711
|
+
* @description 请求接收事件
|
|
712
|
+
* @default 'onRequestReceived'
|
|
713
|
+
* @event TUIRoomEvents#onRequestReceived
|
|
714
|
+
* @param {object} options
|
|
715
|
+
* @param {TUIRequest} options.request 请求接收
|
|
716
|
+
* @example
|
|
717
|
+
* const roomEngine = new TUIRoomEngine();
|
|
718
|
+
* roomEngine.on(TUIRoomEvents.onRequestReceived, ({ request }) => {
|
|
719
|
+
* console.log('roomEngine.onRequestReceived', request);
|
|
720
|
+
* });
|
|
721
|
+
*/
|
|
722
|
+
onRequestReceived = "onRequestReceived",
|
|
723
|
+
/**
|
|
724
|
+
* @description 请求取消事件
|
|
725
|
+
* @default 'onRequestCancelled'
|
|
726
|
+
* @event TUIRoomEvents#onRequestCancelled
|
|
727
|
+
* @param {object} options
|
|
728
|
+
* @param {string} options.requestId 请求Id
|
|
729
|
+
* @param {string} options.userId 取消请求的用户Id
|
|
730
|
+
* @param {TUIRequest} options.request 请求信息,该字段自 v2.3.0 开始支持
|
|
731
|
+
* @param {TUIUserInfo} options.userInfo 处理该请求的 管理员/房主 的用户信息,该字段自 v2.3.0 开始支持
|
|
732
|
+
* @example
|
|
733
|
+
* const roomEngine = new TUIRoomEngine();
|
|
734
|
+
* roomEngine.on(TUIRoomEvents.onRequestCancelled, ({ request, userInfo }) => {
|
|
735
|
+
* console.log('roomEngine.onRequestCancelled', request, userInfo);
|
|
736
|
+
* });
|
|
737
|
+
*/
|
|
738
|
+
onRequestCancelled = "onRequestCancelled",
|
|
739
|
+
/**
|
|
740
|
+
* @description 请求被其他 管理员/房主 处理事件
|
|
741
|
+
* @default 'onRequestProcessed'
|
|
742
|
+
* @event TUIRoomEvents#onRequestProcessed
|
|
743
|
+
* @param {object} options
|
|
744
|
+
* @param {string} options.requestId 请求Id
|
|
745
|
+
* @param {string} options.userId 处理该请求的 管理员/房主 的用户ID
|
|
746
|
+
* @param {TUIRequest} options.request 请求信息,该字段自 v2.3.0 开始支持
|
|
747
|
+
* @param {TUIUserInfo} options.userInfo 处理该请求的 管理员/房主 的用户信息,该字段自 v2.3.0 开始支持
|
|
748
|
+
* @example
|
|
749
|
+
* const roomEngine = new TUIRoomEngine();
|
|
750
|
+
* roomEngine.on(TUIRoomEvents.onRequestProcessed, ({ request, userInfo }) => {
|
|
751
|
+
* console.log('roomEngine.onRequestProcessed', request, userInfo);
|
|
752
|
+
* });
|
|
753
|
+
*/
|
|
754
|
+
onRequestProcessed = "onRequestProcessed",
|
|
755
|
+
/**
|
|
756
|
+
* @since v3.1.0
|
|
757
|
+
* @description 接收文本消息事件
|
|
758
|
+
* @default 'onReceiveTextMessage'
|
|
759
|
+
* @event TUIRoomEvents#onReceiveTextMessage
|
|
760
|
+
* @param {object} options 接收的文本消息
|
|
761
|
+
* @param {string} options.roomId 房间Id
|
|
762
|
+
* @param {string} options.textContent 文本消息内容
|
|
763
|
+
* @param {TUIUserInfo} options.sender 发送者信息
|
|
764
|
+
* @param {number} options.sequence 消息序号
|
|
765
|
+
* @param {object} options.extensionInfo 扩展信息
|
|
766
|
+
* @param {string} options.timestampInSecond 时间戳
|
|
767
|
+
* @example
|
|
768
|
+
* const roomEngine = new TUIRoomEngine();
|
|
769
|
+
* roomEngine.on(TUIRoomEvents.onReceiveTextMessage, (message) => {
|
|
770
|
+
* console.log('roomEngine.onReceiveTextMessage', message);
|
|
771
|
+
* });
|
|
772
|
+
*/
|
|
773
|
+
onReceiveTextMessage = "onReceiveTextMessage",
|
|
774
|
+
/**
|
|
775
|
+
* @since v3.1.0
|
|
776
|
+
* @description 接收自定义消息事件
|
|
777
|
+
* @default 'onReceiveCustomMessage'
|
|
778
|
+
* @event TUIRoomEvents#onReceiveCustomMessage
|
|
779
|
+
* @param {object} options 接收的自定义消息
|
|
780
|
+
* @param {string} options.roomId 房间Id
|
|
781
|
+
* @param {string} options.businessId 业务Id
|
|
782
|
+
* @param {string} options.data 自定义消息内容
|
|
783
|
+
* @param {TUIUserInfo} options.sender 发送者信息
|
|
784
|
+
* @param {number} options.sequence 消息序号
|
|
785
|
+
* @param {string} options.timestampInSecond 时间戳
|
|
786
|
+
* @example
|
|
787
|
+
* const roomEngine = new TUIRoomEngine();
|
|
788
|
+
* roomEngine.on(TUIRoomEvents.onReceiveCustomMessage, (message) => {
|
|
789
|
+
* console.log('roomEngine.onReceiveCustomMessage', message);
|
|
790
|
+
* });
|
|
791
|
+
*/
|
|
792
|
+
onReceiveCustomMessage = "onReceiveCustomMessage",
|
|
793
|
+
/**
|
|
794
|
+
* @description 设备变更事件
|
|
795
|
+
* @default 'onDeviceChange'
|
|
796
|
+
* @event TUIRoomEvents#onDeviceChange
|
|
797
|
+
* @param {object} options
|
|
798
|
+
* @param {string} options.deviceId 设备 Id
|
|
799
|
+
* @param {TRTCDeviceType} options.type 设备类型
|
|
800
|
+
* @param {TRTCDeviceState} options.state 设备变更状态
|
|
801
|
+
* @example
|
|
802
|
+
* const roomEngine = new TUIRoomEngine();
|
|
803
|
+
* roomEngine.on(TUIRoomEvents.onDeviceChange, ({ deviceId, type, state }) => {
|
|
804
|
+
* console.log('roomEngine.onDeviceChange', deviceId, type, state);
|
|
805
|
+
* });
|
|
806
|
+
*/
|
|
807
|
+
onDeviceChange = "onDeviceChange",
|
|
808
|
+
/**
|
|
809
|
+
* @description 屏幕分享停止事件,当用户使用浏览器自带的【停止分享】按钮结束屏幕共享时,该用户会收到 'onUserScreenCaptureStopped' 事件用来修改屏幕共享状态。
|
|
810
|
+
* @default 'onUserScreenCaptureStopped'
|
|
811
|
+
* @event TUIRoomEvents#onUserScreenCaptureStopped
|
|
812
|
+
* @example
|
|
813
|
+
* const roomEngine = new TUIRoomEngine();
|
|
814
|
+
* roomEngine.on(TUIRoomEvents.onUserScreenCaptureStopped, () => {
|
|
815
|
+
* console.log('roomEngine.onUserScreenCaptureStopped');
|
|
816
|
+
* });
|
|
817
|
+
*/
|
|
818
|
+
onUserScreenCaptureStopped = "onUserScreenCaptureStopped",
|
|
819
|
+
/**
|
|
820
|
+
* @description 自动播放失败的事件,监听到该事件后可以引导用户与页面进行交互
|
|
821
|
+
* @default 'onAutoPlayFailed'
|
|
822
|
+
* @event TUIRoomEvents#onAutoPlayFailed
|
|
823
|
+
* @example
|
|
824
|
+
* const roomEngine = new TUIRoomEngine();
|
|
825
|
+
* roomEngine.on(TUIRoomEvents.onAutoPlayFailed, ({userId, resume}) => {
|
|
826
|
+
* // 自动播放失败,引导用户与页面进行交互
|
|
827
|
+
* });
|
|
828
|
+
*/
|
|
829
|
+
onAutoPlayFailed = "onAutoPlayFailed",
|
|
830
|
+
/**
|
|
831
|
+
* @description 房间自定义信息改变的事件
|
|
832
|
+
* @default 'onRoomMetadataChanged'
|
|
833
|
+
* @event TUIRoomEvents#onRoomMetadataChanged
|
|
834
|
+
* @example
|
|
835
|
+
* const roomEngine = new TUIRoomEngine();
|
|
836
|
+
* roomEngine.on(TUIRoomEvents.onRoomMetadataChanged, ({key, value}) => {
|
|
837
|
+
* console.log(key, value);
|
|
838
|
+
* });
|
|
839
|
+
*/
|
|
840
|
+
onRoomMetadataChanged = "onRoomMetadataChanged"
|
|
841
|
+
}
|
|
842
|
+
export declare enum TUIRoomDeviceMangerEvents {
|
|
843
|
+
/**
|
|
844
|
+
* @description 设备变更事件
|
|
845
|
+
* @default 'onDeviceChange'
|
|
846
|
+
* @event TUIRoomDeviceMangerEvents#onDeviceChange
|
|
847
|
+
* @param {object} options
|
|
848
|
+
* @param {string} options.deviceId 设备 Id
|
|
849
|
+
* @param {TRTCDeviceType} options.type 设备类型
|
|
850
|
+
* @param {TRTCDeviceState} options.state 设备变更状态
|
|
851
|
+
* @example
|
|
852
|
+
* const roomEngine = new TUIRoomEngine();
|
|
853
|
+
* const deviceManager = roomEngine.getDeviceManager();
|
|
854
|
+
* deviceManager.on(TUIRoomDeviceMangerEvents.onDeviceChange, ({ deviceId, type, state }) => {
|
|
855
|
+
* console.log('deviceManager.onDeviceChange', deviceId, type, state);
|
|
856
|
+
* });
|
|
857
|
+
*/
|
|
858
|
+
onDeviceChanged = "onDeviceChanged",
|
|
859
|
+
/**
|
|
860
|
+
* @description 麦克风测试音量
|
|
861
|
+
* @default 'onTestMicVolume'
|
|
862
|
+
* @event TUIRoomDeviceMangerEvents#onTestMicVolume
|
|
863
|
+
* @param {object} options
|
|
864
|
+
* @param {number} options.volume 麦克风测试音量(0-100)
|
|
865
|
+
* @example
|
|
866
|
+
* const roomEngine = new TUIRoomEngine();
|
|
867
|
+
* const deviceManager = roomEngine.getDeviceManager();
|
|
868
|
+
* deviceManager.on(TUIRoomDeviceMangerEvents.onTestMicVolume, ({ volume }) => {
|
|
869
|
+
* console.log('deviceManager.onTestMicVolume', volume);
|
|
870
|
+
* });
|
|
871
|
+
*/
|
|
872
|
+
onTestMicVolume = "onTestMicVolume",
|
|
873
|
+
/**
|
|
874
|
+
* @description 扬声器测试音量,仅 Electron 端支持
|
|
875
|
+
* @default 'onTestSpeakerVolume'
|
|
876
|
+
* @event TUIRoomDeviceMangerEvents#onTestSpeakerVolume
|
|
877
|
+
* @param {object} options
|
|
878
|
+
* @param {number} options.volume 扬声器测试音量(0-100)
|
|
879
|
+
* @example
|
|
880
|
+
* const roomEngine = new TUIRoomEngine();
|
|
881
|
+
* const deviceManager = roomEngine.getDeviceManager();
|
|
882
|
+
* deviceManager.on(TUIRoomDeviceMangerEvents.onTestSpeakerVolume, ({ volume }) => {
|
|
883
|
+
* console.log('deviceManager.onTestSpeakerVolume', volume);
|
|
884
|
+
* });
|
|
885
|
+
*/
|
|
886
|
+
onTestSpeakerVolume = "onTestSpeakerVolume"
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* @since v2.5.0
|
|
890
|
+
* **TUIConferenceListManager 事件列表**<br>
|
|
891
|
+
* @namespace TUIConferenceListManagerEvents
|
|
892
|
+
*/
|
|
893
|
+
export declare enum TUIConferenceListManagerEvents {
|
|
894
|
+
/**
|
|
895
|
+
* @description 会议预定回调
|
|
896
|
+
* @default 'onConferenceScheduled'
|
|
897
|
+
* @event TUIConferenceListManagerEvents#onConferenceScheduled
|
|
898
|
+
* @param {object} options
|
|
899
|
+
* @param {string} options.conferenceInfo 会议信息。
|
|
900
|
+
*
|
|
901
|
+
* @example
|
|
902
|
+
* const roomEngine = new TUIRoomEngine();
|
|
903
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
904
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onConferenceScheduled, ({ conferenceInfo }) => {
|
|
905
|
+
* console.log('conferenceListManager.onConferenceScheduled', conferenceInfo);
|
|
906
|
+
* })
|
|
907
|
+
*/
|
|
908
|
+
onConferenceScheduled = "onConferenceScheduled",
|
|
909
|
+
/**
|
|
910
|
+
* @description 会议即将开始回调
|
|
911
|
+
* @default 'onConferenceWillStart'
|
|
912
|
+
* @event TUIConferenceListManagerEvents#onConferenceWillStart
|
|
913
|
+
* @param {object} options
|
|
914
|
+
* @param {string} options.conferenceInfo 会议信息。
|
|
915
|
+
*
|
|
916
|
+
* @example
|
|
917
|
+
* const roomEngine = new TUIRoomEngine();
|
|
918
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
919
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onConferenceWillStart, ({ conferenceInfo }) => {
|
|
920
|
+
* console.log('conferenceListManager.onConferenceWillStart', conferenceInfo);
|
|
921
|
+
* })
|
|
922
|
+
*/
|
|
923
|
+
onConferenceWillStart = "onConferenceWillStart",
|
|
924
|
+
/**
|
|
925
|
+
* @description 会议取消回调
|
|
926
|
+
*
|
|
927
|
+
* @param {object} options
|
|
928
|
+
* @param {string} options.roomId 会议Id,即房间 roomId 。
|
|
929
|
+
* @param {TUIConferenceCancelReason} options.reason 会议取消原因。
|
|
930
|
+
* @param {TUIUserInfo} options.operateUser 取消会议操作者信息。
|
|
931
|
+
*
|
|
932
|
+
* @example
|
|
933
|
+
* const roomEngine = new TUIRoomEngine();
|
|
934
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
935
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onConferenceCancelled, ({ roomId, reason, operateUser }) => {
|
|
936
|
+
* console.log('conferenceListManager.onConferenceCancelled', roomId, reason, operateUser);
|
|
937
|
+
* })
|
|
938
|
+
*/
|
|
939
|
+
onConferenceCancelled = "onConferenceCancelled",
|
|
940
|
+
/**
|
|
941
|
+
* @description 会议信息变更回调
|
|
942
|
+
*
|
|
943
|
+
* @param {object} options
|
|
944
|
+
* @param {TUIConferenceModifyInfo} options.conferenceModifyInfo 会议信息。
|
|
945
|
+
*
|
|
946
|
+
* @example
|
|
947
|
+
* const roomEngine = new TUIRoomEngine();
|
|
948
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
949
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onConferenceInfoChanged, ({ conferenceModifyInfo }) => {
|
|
950
|
+
* console.log('conferenceListManager.onConferenceInfoChanged', conferenceModifyInfo);
|
|
951
|
+
* })
|
|
952
|
+
*/
|
|
953
|
+
onConferenceInfoChanged = "onConferenceInfoChanged",
|
|
954
|
+
/**
|
|
955
|
+
* @description 参会人员变更回调
|
|
956
|
+
*
|
|
957
|
+
* @param {object} options
|
|
958
|
+
* @param {string} options.roomId 会议Id,即房间roomId。
|
|
959
|
+
* @param {Array<TUIUserInfo>} options.leftUsers 离开成员列表。
|
|
960
|
+
* @param {Array<TUIUserInfo>} options.joinedUsers 新加入成员列表。
|
|
961
|
+
*
|
|
962
|
+
* @example
|
|
963
|
+
* const roomEngine = new TUIRoomEngine();
|
|
964
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
965
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onScheduleAttendeesChanged, ({ roomId, leftUsers, joinedUsers }) => {
|
|
966
|
+
* console.log('conferenceListManager.onScheduleAttendeesChanged', roomId, leftUsers, joinedUsers);
|
|
967
|
+
* })
|
|
968
|
+
*/
|
|
969
|
+
onScheduleAttendeesChanged = "onScheduleAttendeesChanged",
|
|
970
|
+
/**
|
|
971
|
+
* @description 会议状态变更回调
|
|
972
|
+
*
|
|
973
|
+
* @param {object} options
|
|
974
|
+
* @param {string} options.roomId 会议Id,即房间roomId。
|
|
975
|
+
* @param {TUIConferenceStatus} options.status 会议状态。
|
|
976
|
+
*
|
|
977
|
+
* @example
|
|
978
|
+
* const roomEngine = new TUIRoomEngine();
|
|
979
|
+
* const conferenceListManager = roomEngine.getConferenceListManager();
|
|
980
|
+
* conferenceListManager.on(TUIConferenceListManagerEvents.onConferenceStatusChanged, ({ roomId, status }) => {
|
|
981
|
+
* console.log('conferenceListManager.onConferenceStatusChanged', roomId, status );
|
|
982
|
+
* })
|
|
983
|
+
*/
|
|
984
|
+
onConferenceStatusChanged = "onConferenceStatusChanged"
|
|
985
|
+
}
|
|
986
|
+
/**
|
|
987
|
+
* @since v2.6.0
|
|
988
|
+
* **TUIConferenceInvitationManager 事件列表**<br>
|
|
989
|
+
* @namespace TUIConferenceInvitationManagerEvents
|
|
990
|
+
*/
|
|
991
|
+
export declare enum TUIConferenceInvitationManagerEvents {
|
|
992
|
+
/**
|
|
993
|
+
* @description 收到会中邀请回调
|
|
994
|
+
* @default 'onReceiveInvitation'
|
|
995
|
+
* @event TUIConferenceInvitationManagerEvents#onReceiveInvitation
|
|
996
|
+
* @param {object} options
|
|
997
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
998
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
999
|
+
* @param {string} options.extensionInfo 自定义扩展信息
|
|
1000
|
+
*
|
|
1001
|
+
*
|
|
1002
|
+
* @example
|
|
1003
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1004
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1005
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onReceiveInvitation, ({ roomInfo, invitation, extensionInfo }) => {
|
|
1006
|
+
* console.log('conferenceInvitationManager.onReceiveInvitation', roomInfo, invitation, extensionInfo);
|
|
1007
|
+
* })
|
|
1008
|
+
*/
|
|
1009
|
+
onReceiveInvitation = "onReceiveInvitation",
|
|
1010
|
+
/**
|
|
1011
|
+
* @description 邀请在其他设备处理的回调
|
|
1012
|
+
* @default 'onInvitationHandledByOtherDevice'
|
|
1013
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationHandledByOtherDevice
|
|
1014
|
+
* @param {object} options
|
|
1015
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1016
|
+
* @param {boolean} options.accepted 接受状态。
|
|
1017
|
+
*
|
|
1018
|
+
*
|
|
1019
|
+
* @example
|
|
1020
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1021
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1022
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationHandledByOtherDevice, ({ roomInfo, accepted }) => {
|
|
1023
|
+
* console.log('conferenceInvitationManager.onInvitationHandledByOtherDevice', roomInfo, accepted);
|
|
1024
|
+
* })
|
|
1025
|
+
*/
|
|
1026
|
+
onInvitationHandledByOtherDevice = "onInvitationHandledByOtherDevice",
|
|
1027
|
+
/**
|
|
1028
|
+
* @description 会中邀请取消的回调
|
|
1029
|
+
* @default 'onInvitationCancelled'
|
|
1030
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationCancelled
|
|
1031
|
+
* @param {object} options
|
|
1032
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1033
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1034
|
+
*
|
|
1035
|
+
*
|
|
1036
|
+
* @example
|
|
1037
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1038
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1039
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationCancelled, ({ roomInfo, invitation }) => {
|
|
1040
|
+
* console.log('conferenceInvitationManager.onInvitationCancelled', roomInfo, invitation);
|
|
1041
|
+
* })
|
|
1042
|
+
*/
|
|
1043
|
+
onInvitationCancelled = "onInvitationCancelled",
|
|
1044
|
+
/**
|
|
1045
|
+
* @description 会中邀请接受的回调
|
|
1046
|
+
* @default 'onInvitationAccepted'
|
|
1047
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationAccepted
|
|
1048
|
+
* @param {object} options
|
|
1049
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1050
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1051
|
+
*
|
|
1052
|
+
*
|
|
1053
|
+
* @example
|
|
1054
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1055
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1056
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationAccepted, ({ roomInfo, invitation }) => {
|
|
1057
|
+
* console.log('conferenceInvitationManager.onInvitationAccepted', roomInfo, invitation);
|
|
1058
|
+
* })
|
|
1059
|
+
*/
|
|
1060
|
+
onInvitationAccepted = "onInvitationAccepted",
|
|
1061
|
+
/**
|
|
1062
|
+
* @description 会中邀请拒绝的回调
|
|
1063
|
+
* @default 'onInvitationRejected'
|
|
1064
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationRejected
|
|
1065
|
+
* @param {object} options
|
|
1066
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1067
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1068
|
+
* @param {TUIInvitationRejectedReason} options.reason 拒绝加入会议的原因。
|
|
1069
|
+
*
|
|
1070
|
+
*
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1074
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1075
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationRejected, ({ roomInfo, invitation, reason }) => {
|
|
1076
|
+
* console.log('conferenceInvitationManager.onInvitationRejected', roomInfo, invitation, reason);
|
|
1077
|
+
* })
|
|
1078
|
+
*/
|
|
1079
|
+
onInvitationRejected = "onInvitationRejected",
|
|
1080
|
+
/**
|
|
1081
|
+
* @description 会中邀请超时的回调
|
|
1082
|
+
* @default 'onInvitationTimeout'
|
|
1083
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationTimeout
|
|
1084
|
+
* @param {object} options
|
|
1085
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1086
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1087
|
+
*
|
|
1088
|
+
*
|
|
1089
|
+
* @example
|
|
1090
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1091
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1092
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationTimeout, ({ roomInfo, invitation }) => {
|
|
1093
|
+
* console.log('conferenceInvitationManager.onInvitationTimeout', roomInfo, invitation);
|
|
1094
|
+
* })
|
|
1095
|
+
*/
|
|
1096
|
+
onInvitationTimeout = "onInvitationTimeout",
|
|
1097
|
+
/**
|
|
1098
|
+
* @description 会中邀请被管理员撤回的回调
|
|
1099
|
+
* @default 'onInvitationRevokedByAdmin'
|
|
1100
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationRevokedByAdmin
|
|
1101
|
+
* @param {object} options
|
|
1102
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1103
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1104
|
+
* @param {TUIUserInfo} options.operateUser 撤回邀请的人的信息
|
|
1105
|
+
*
|
|
1106
|
+
*
|
|
1107
|
+
* @example
|
|
1108
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1109
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1110
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationRevokedByAdmin, ({ roomInfo, invitation, userRole }) => {
|
|
1111
|
+
* console.log('conferenceInvitationManager.onInvitationRevokedByAdmin', roomInfo, invitation, operateUser);
|
|
1112
|
+
* })
|
|
1113
|
+
*/
|
|
1114
|
+
onInvitationRevokedByAdmin = "onInvitationRevokedByAdmin",
|
|
1115
|
+
/**
|
|
1116
|
+
* @description 新添加会中邀请的回调
|
|
1117
|
+
* @default 'onInvitationAdded'
|
|
1118
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationAdded
|
|
1119
|
+
* @param {object} options
|
|
1120
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1121
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1122
|
+
*
|
|
1123
|
+
*
|
|
1124
|
+
* @example
|
|
1125
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1126
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1127
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationAdded, ({ roomInfo, invitation }) => {
|
|
1128
|
+
* console.log('conferenceInvitationManager.onInvitationAdded', roomInfo, invitation);
|
|
1129
|
+
* })
|
|
1130
|
+
*/
|
|
1131
|
+
onInvitationAdded = "onInvitationAdded",
|
|
1132
|
+
/**
|
|
1133
|
+
* @description 会中邀请被移除的回调
|
|
1134
|
+
* @default 'onInvitationRemoved'
|
|
1135
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationRemoved
|
|
1136
|
+
* @param {object} options
|
|
1137
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1138
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1139
|
+
*
|
|
1140
|
+
*
|
|
1141
|
+
* @example
|
|
1142
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1143
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1144
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationRemoved, ({ roomInfo, invitation }) => {
|
|
1145
|
+
* console.log('conferenceInvitationManager.onInvitationRemoved', roomInfo, invitation);
|
|
1146
|
+
* })
|
|
1147
|
+
*/
|
|
1148
|
+
onInvitationRemoved = "onInvitationRemoved",
|
|
1149
|
+
/**
|
|
1150
|
+
* @description 会中邀请状态变更的回调
|
|
1151
|
+
* @default 'onInvitationStatusChanged'
|
|
1152
|
+
* @event TUIConferenceInvitationManagerEvents#onInvitationStatusChanged
|
|
1153
|
+
* @param {object} options
|
|
1154
|
+
* @param {TUIRoomInfo} options.roomInfo 会议信息。
|
|
1155
|
+
* @param {TUIInvitation} options.invitation 邀请信息。
|
|
1156
|
+
*
|
|
1157
|
+
*
|
|
1158
|
+
* @example
|
|
1159
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1160
|
+
* const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
|
|
1161
|
+
* conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationStatusChanged, ({ roomInfo, invitation }) => {
|
|
1162
|
+
* console.log('conferenceInvitationManager.onInvitationStatusChanged', roomInfo, invitation);
|
|
1163
|
+
* })
|
|
1164
|
+
*/
|
|
1165
|
+
onInvitationStatusChanged = "onInvitationStatusChanged"
|
|
1166
|
+
}
|
|
1167
|
+
export type TUILiveInfo = {
|
|
1168
|
+
basicRoomInfo: TUIRoomInfo;
|
|
1169
|
+
isGiftEnabled: boolean;
|
|
1170
|
+
isLikeEnabled: boolean;
|
|
1171
|
+
isPublicVisible: boolean;
|
|
1172
|
+
activityStatus: number;
|
|
1173
|
+
viewCount: number;
|
|
1174
|
+
coverUrl: string;
|
|
1175
|
+
backgroundUrl: string;
|
|
1176
|
+
categoryList: Array<number>;
|
|
1177
|
+
};
|
|
1178
|
+
export type TUILiveModifyInfo = {
|
|
1179
|
+
roomId: string;
|
|
1180
|
+
isPublicVisible?: boolean;
|
|
1181
|
+
activityStatus?: number;
|
|
1182
|
+
coverUrl?: string;
|
|
1183
|
+
backgroundUrl?: string;
|
|
1184
|
+
categoryList?: Array<number>;
|
|
1185
|
+
};
|
|
1186
|
+
export declare enum TUILiveModifyFlag {
|
|
1187
|
+
kNone = 0,
|
|
1188
|
+
kActivityStatus = 256,
|
|
1189
|
+
kCoverUrl = 512,
|
|
1190
|
+
kCategory = 1024,
|
|
1191
|
+
kEnableGift = 2048,
|
|
1192
|
+
kEnableLike = 4096,
|
|
1193
|
+
kPublic = 8192,
|
|
1194
|
+
kBackgroundUrl = 262144
|
|
1195
|
+
}
|
|
1196
|
+
export type TUILiveListResult = {
|
|
1197
|
+
cursor: string;
|
|
1198
|
+
liveInfoList: Array<TUILiveInfo>;
|
|
1199
|
+
};
|
|
1200
|
+
/**
|
|
1201
|
+
* @since v2.9.0
|
|
1202
|
+
* ** TUILiveListManager 事件列表**<br>
|
|
1203
|
+
*/
|
|
1204
|
+
export declare enum TUILiveListManagerEvents {
|
|
1205
|
+
/**
|
|
1206
|
+
* @description 直播间信息发生变化事件回调
|
|
1207
|
+
* @default 'onLiveInfoChanged'
|
|
1208
|
+
* @event TUILiveListManagerEvents#onLiveInfoChanged
|
|
1209
|
+
* @param {object} options
|
|
1210
|
+
* @param {TUILiveInfo} options.liveInfo 直播间信息
|
|
1211
|
+
* @param {TUILiveModifyFlag} options.modifyFlag 直播间修改标识
|
|
1212
|
+
*
|
|
1213
|
+
* @example
|
|
1214
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1215
|
+
* const liveListManager = roomEngine.getLiveListManager();
|
|
1216
|
+
* liveListManager.on(TUILiveListManagerEvents.onLiveInfoChanged, ({ liveInfo, modifyFlag}) => {
|
|
1217
|
+
* console.log('liveListManager.onLiveInfoChanged', liveInfo, modifyFlag);
|
|
1218
|
+
* });
|
|
1219
|
+
*/
|
|
1220
|
+
onLiveInfoChanged = "onLiveInfoChanged"
|
|
1221
|
+
}
|
|
1222
|
+
export declare enum TUILiveLayoutManagerEvents {
|
|
1223
|
+
/**
|
|
1224
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1225
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
1226
|
+
* const callback = (roomId, layoutInfo) => {
|
|
1227
|
+
* console.log('liveLayoutManager.onLiveVideoLayoutChanged', roomId, layoutInfo);
|
|
1228
|
+
* };
|
|
1229
|
+
* liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
1230
|
+
*/
|
|
1231
|
+
onLiveVideoLayoutChanged = "onLiveVideoLayoutChanged"
|
|
1232
|
+
}
|
|
1233
|
+
/**
|
|
1234
|
+
* @since v3.0.5
|
|
1235
|
+
* **TUILiveConnectionManager** 事件列表<br>
|
|
1236
|
+
*/
|
|
1237
|
+
export declare enum TUILiveConnectionManagerEvents {
|
|
1238
|
+
/**
|
|
1239
|
+
* @description 接收到连线请求的监听事件
|
|
1240
|
+
* @default 'onConnectionRequestReceived'
|
|
1241
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestReceived
|
|
1242
|
+
* @param {inviter} options 连线请求发起者
|
|
1243
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1244
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1245
|
+
* @param {roomId} options.roomId 房间号
|
|
1246
|
+
* @param {userId} options.userId ID
|
|
1247
|
+
* @param {userName} options.userName 用户名
|
|
1248
|
+
*
|
|
1249
|
+
* @example
|
|
1250
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1251
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1252
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReceived, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1253
|
+
* console.log('liveConnectionManager.onConnectionRequestReceived', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1254
|
+
* });
|
|
1255
|
+
*/
|
|
1256
|
+
onConnectionRequestReceived = "onConnectionRequestReceived",
|
|
1257
|
+
/**
|
|
1258
|
+
* @description 连线房间主播人数变更的监听事件
|
|
1259
|
+
* @default 'onConnectionUserListChanged'
|
|
1260
|
+
* @event TUILiveConnectionManagerEvents#onConnectionUserListChanged
|
|
1261
|
+
* @param {object} options
|
|
1262
|
+
* @param {connectedList} options.connectedList 包含连线房间所有主播列表
|
|
1263
|
+
* @param {joinedList} options.joinedList 本次事件变更加入连线房间的主播列表
|
|
1264
|
+
* @param {leavedList} options.leavedList 本次事件变更离开连线房间的主播列表
|
|
1265
|
+
*
|
|
1266
|
+
* @example
|
|
1267
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1268
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1269
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionUserListChanged, ({ connectedList, joinedList, leavedList }) => {
|
|
1270
|
+
* console.log('liveConnectionManager.onConnectionUserListChanged', connectedList, joinedList, leavedList);
|
|
1271
|
+
* });
|
|
1272
|
+
*/
|
|
1273
|
+
onConnectionUserListChanged = "onConnectionUserListChanged",
|
|
1274
|
+
/**
|
|
1275
|
+
* @description 连线请求被取消的监听事件
|
|
1276
|
+
* @default 'onConnectionRequestCancelled'
|
|
1277
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestCancelled
|
|
1278
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1279
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1280
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1281
|
+
* @param {roomId} options.roomId 房间号
|
|
1282
|
+
* @param {userId} options.userId ID
|
|
1283
|
+
* @param {userName} options.userName 用户名
|
|
1284
|
+
*
|
|
1285
|
+
* @example
|
|
1286
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1287
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1288
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestCancelled, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1289
|
+
* console.log('liveConnectionManager.onConnectionRequestCancelled', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1290
|
+
* });
|
|
1291
|
+
*/
|
|
1292
|
+
onConnectionRequestCancelled = "onConnectionRequestCancelled",
|
|
1293
|
+
/**
|
|
1294
|
+
* @description 连线请求被同意的监听事件
|
|
1295
|
+
* @default 'onConnectionRequestAccept'
|
|
1296
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestAccept
|
|
1297
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1298
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1299
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1300
|
+
* @param {roomId} options.roomId 房间号
|
|
1301
|
+
* @param {userId} options.userId ID
|
|
1302
|
+
* @param {userName} options.userName 用户名
|
|
1303
|
+
*
|
|
1304
|
+
* @example
|
|
1305
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1306
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1307
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestAccept, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1308
|
+
* console.log('liveConnectionManager.onConnectionRequestAccept', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1309
|
+
* });
|
|
1310
|
+
*/
|
|
1311
|
+
onConnectionRequestAccept = "onConnectionRequestAccept",
|
|
1312
|
+
/**
|
|
1313
|
+
* @description 连线请求被拒绝的监听事件
|
|
1314
|
+
* @default 'onConnectionRequestReject'
|
|
1315
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestReject
|
|
1316
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1317
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1318
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1319
|
+
* @param {roomId} options.roomId 房间号
|
|
1320
|
+
* @param {userId} options.userId ID
|
|
1321
|
+
* @param {userName} options.userName 用户名
|
|
1322
|
+
*
|
|
1323
|
+
* @example
|
|
1324
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1325
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1326
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReject, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1327
|
+
* console.log('liveConnectionManager.onConnectionRequestReject', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1328
|
+
* });
|
|
1329
|
+
*/
|
|
1330
|
+
onConnectionRequestReject = "onConnectionRequestReject",
|
|
1331
|
+
/**
|
|
1332
|
+
* @description 邀请超时的监听事件
|
|
1333
|
+
* @default 'onConnectionRequestTimeout'
|
|
1334
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestTimeout
|
|
1335
|
+
* @param {invitee} invitee 连线请求被邀请者
|
|
1336
|
+
* @param {avatarUrl} invitee.avatarUrl 头像
|
|
1337
|
+
* @param {joinConnectionTime} invitee.joinConnectionTime 加入连线时间
|
|
1338
|
+
* @param {roomId} invitee.roomId 房间号
|
|
1339
|
+
* @param {userId} invitee.userId ID
|
|
1340
|
+
* @param {userName} invitee.userName 用户名
|
|
1341
|
+
* @param {inviter} inviter 连线请求邀请者
|
|
1342
|
+
* @param {avatarUrl} inviter.avatarUrl 头像
|
|
1343
|
+
* @param {joinConnectionTime} inviter.joinConnectionTime 加入连线时间
|
|
1344
|
+
* @param {roomId} inviter.roomId 房间号
|
|
1345
|
+
* @param {userId} inviter.userId ID
|
|
1346
|
+
* @param {userName} inviter.userName 用户名
|
|
1347
|
+
*
|
|
1348
|
+
* @example
|
|
1349
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1350
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1351
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestTimeout, (invitee, inviter) => {
|
|
1352
|
+
* console.log('liveConnectionManager.onConnectionRequestTimeout', invitee, inviter);
|
|
1353
|
+
* });
|
|
1354
|
+
*/
|
|
1355
|
+
onConnectionRequestTimeout = "onConnectionRequestTimeout"
|
|
1356
|
+
}
|