@tencentcloud/tuiroom-engine-js 2.2.3 → 2.3.1

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/index.d.ts CHANGED
@@ -165,7 +165,7 @@ type TUIVideoEncoderParams = {
165
165
  };
166
166
  declare enum TUIRoomType {
167
167
  kConference = 1,
168
- kLivingRoom = 2
168
+ kLive = 2
169
169
  }
170
170
  declare enum TUISpeechMode {
171
171
  kFreeToSpeak = 1,
@@ -228,11 +228,14 @@ type TUIUserInfo = {
228
228
  hasAudioStream: boolean;
229
229
  hasVideoStream: boolean;
230
230
  hasScreenStream: boolean;
231
+ isMessageDisabled: boolean;
231
232
  roomCustomInfo: Record<string, any>;
232
233
  };
233
234
  type TUISeatInfo = {
234
235
  index: number;
235
236
  userId: string;
237
+ userName: string;
238
+ avatarUrl: string;
236
239
  locked: boolean;
237
240
  isVideoLocked: boolean;
238
241
  isAudioLocked: boolean;
@@ -242,6 +245,8 @@ type TUIRequest = {
242
245
  timestamp: number;
243
246
  requestId: string;
244
247
  userId: string;
248
+ userName: string;
249
+ avatarUrl: string;
245
250
  content: string;
246
251
  };
247
252
  type TUIRequestCallback = {
@@ -392,6 +397,20 @@ declare enum TUIRoomEvents {
392
397
  * });
393
398
  */
394
399
  onRoomSeatModeChanged = "onRoomSeatModeChanged",
400
+ /**
401
+ * @description 房间内人数变化事件
402
+ * @default 'onRoomUserCountChanged'
403
+ * @event TUIRoomEvents#onRoomUserCountChanged
404
+ * @param {object} options
405
+ * @param {string} options.roomId 房间号
406
+ * @param {number} options.userCount 房间内人数
407
+ * @example
408
+ * const roomEngine = new TUIRoomEngine();
409
+ * roomEngine.on(TUIRoomEvents.onRoomUserCountChanged, ({ roomId, userCount }) =>{
410
+ * console.log('roomEngine.onRoomUserCountChanged', roomId, userCount);
411
+ * });
412
+ */
413
+ onRoomUserCountChanged = "onRoomUserCountChanged",
395
414
  /**
396
415
  * @description 所有成员摄像头使用权限改变事件
397
416
  * @default 'onAllUserCameraDisableChanged'
@@ -1044,7 +1063,7 @@ declare class TUIRoomEngine {
1044
1063
  * @param {string=} [options.roomName=roomId] 房间名称,默认值为 roomId,传入的值不能为空字符串
1045
1064
  * @param {TUIRoomType=} [options.roomType=TUIRoomType.kConference] 房间类型, 默认值为 TUIRoomType.kConference <br>
1046
1065
  * 办公协同、医疗问诊、远程会议、教育场景,roomType 设置为 TUIRoomType.kConference
1047
- * 电商直播、语聊房场景,roomType 设置为 TUIRoomType.kLivingRoom
1066
+ * 电商直播、语聊房场景,roomType 设置为 TUIRoomType.kLive
1048
1067
  * @param {boolean=} [options.isSeatEnabled=false] 是否开启麦位控制,默认值为 false
1049
1068
  * @param {TUISeatMode=} [options.seatMode=TUISeatMode.kFreeToTake] 上麦模式(开启麦位控制后生效),默认值为 TUISeatMode.kFreeToTake <br>
1050
1069
  * 自由上麦模式,台下观众可以自由上麦,无需申请,seatMode 设置为 TUISeatMode.kFreeToTake
@@ -1055,7 +1074,7 @@ declare class TUIRoomEngine {
1055
1074
  * @param {boolean=} [options.isMessageDisableForAllUser=false] 是否允许成员发送消息,默认不禁止(创建房间可选参数)
1056
1075
  * @param {number=} options.maxSeatCount 最大麦位数量 (创建房间可选参数)<br>
1057
1076
  * roomType 为 TUIRoomType.kConference (教育及会议场景) 时,maxSeatCount 值不做限制;
1058
- * roomType 为 TUIRoomType.kLivingRoom (直播场景) 时,maxSeatCount 最大限制为 16;
1077
+ * roomType 为 TUIRoomType.kLive (直播场景) 时,maxSeatCount 最大限制为 16;
1059
1078
  * @returns {Promise<void>}
1060
1079
  *
1061
1080
  * @example
@@ -1083,6 +1102,7 @@ declare class TUIRoomEngine {
1083
1102
  * 进入房间接口
1084
1103
  * @param {object} options
1085
1104
  * @param {string} options.roomId 房间号,字符串类型
1105
+ * @param {TUIRoomType} options.roomType 房间类型, 默认值为 TUIRoomType.kConference (自 v2.3.0 支持)
1086
1106
  * @returns {Promise<TUIRoomInfo>} roomInfo
1087
1107
  * 该接口返回当前房间信息
1088
1108
  *
@@ -1090,10 +1110,12 @@ declare class TUIRoomEngine {
1090
1110
  * const roomEngine = new TUIRoomEngine();
1091
1111
  * const roomDetailInfo = await roomEngine.enterRoom({
1092
1112
  * roomId: '12345',
1113
+ * roomType: TUIRoomType.kConference, // 设置房间类型为 TUIRoomType.kConference 类型
1093
1114
  * });
1094
1115
  */
1095
1116
  enterRoom(options: {
1096
1117
  roomId: string;
1118
+ roomType: TUIRoomType;
1097
1119
  }): Promise<TUIRoomInfo>;
1098
1120
  /**
1099
1121
  * 解散房间接口,解散房间必须由房间所有者发起,解散房间之后房间不可进入
@@ -1765,7 +1787,7 @@ declare class TUIRoomEngine {
1765
1787
  * @param {object} options
1766
1788
  * @param {number} options.maxSeatCount 设置房间麦位最大值<br/>
1767
1789
  * roomType 为 TUIRoomType.kConference (教育及会议场景) 时,maxSeatCount 值不做限制;
1768
- * roomType 为 TUIRoomType.kLivingRoom (直播场景) 时,maxSeatCount 最大限制为 16;
1790
+ * roomType 为 TUIRoomType.kLive (直播场景) 时,maxSeatCount 最大限制为 16;
1769
1791
  * @returns {Promise<void>}
1770
1792
  * const roomEngine = new TUIRoomEngine();
1771
1793
  * await roomEngine.createRoom({ roomId: '12345' });