@tencentcloud/tuiroom-engine-js 3.3.0-beta.4 → 3.3.0-beta.5

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
@@ -1,14 +1,13 @@
1
1
  import { ChatSDK } from '@tencentcloud/chat';
2
2
  export { default as TIM, default as TencentCloudChat } from '@tencentcloud/chat';
3
3
  import TRTCCloud, { TRTCScreenCaptureSourceInfo, TRTCDeviceInfo } from 'trtc-cloud-js-sdk';
4
- export { Rect, default as TRTCCloud, TRTCDeviceInfo, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCMediaMixingEncParam, TRTCMediaMixingEvent, TRTCMediaSource, TRTCMediaSourceType, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureSourceType, TRTCVideoEncParam, TRTCVideoFillMode, TRTCVideoMirrorType, TRTCVideoResolution, TRTCVideoResolutionMode, TRTCVideoRotation, TRTCVideoStreamType, TRTCVolumeInfo } from 'trtc-cloud-js-sdk';
4
+ export { Rect, default as TRTCCloud, TRTCDeviceInfo, TRTCDeviceState, TRTCDeviceType, TRTCLogLevel, TRTCScreenCaptureSourceInfo, TRTCScreenCaptureSourceType, TRTCVideoEncParam, TRTCVideoFillMode, TRTCVideoMirrorType, TRTCVideoResolution, TRTCVideoResolutionMode, TRTCVideoRotation, TRTCVideoStreamType, TRTCVolumeInfo } from 'trtc-cloud-js-sdk';
5
5
 
6
6
  declare enum TUIErrorCode {
7
7
  ERR_SUCC = 0,
8
8
  ERR_FAILED = -1,
9
9
  ERR_FREQ_LIMIT = -2,
10
10
  ERR_REPEAT_OPERATION = -3,
11
- ERR_ROOM_MISMATCH = -4,
12
11
  ERR_SDKAPPID_NOT_FOUND = -1000,
13
12
  ERR_INVALID_PARAMETER = -1001,
14
13
  ERR_SDK_NOT_INITIALIZED = -1002,
@@ -54,14 +53,9 @@ declare enum TUIErrorCode {
54
53
  ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN = -2373,
55
54
  ERR_SEND_MESSAGE_DISABLED_FOR_ALL = -2380,
56
55
  ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT = -2381,
57
- ERR_ROOM_NOT_SUPPORT_PRELOADING = -4001,
58
- ERR_CALL_IN_PROGRESS = -6001,
59
- ERR_SERVER_SYSTEM_ERROR = 100001,
60
- ERR_SERVER_INVALID_PARAMETER = 100002,
61
56
  ERR_ROOM_ID_OCCUPIED = 100003,
62
57
  ERR_ROOM_ID_NOT_EXIST = 100004,
63
58
  ERR_USER_NOT_ENTERED = 100005,
64
- ERR_NO_PERMISSION = 100006,
65
59
  ERR_NEED_PASSWORD = 100018,
66
60
  ERR_WRONG_PASSWORD = 100019,
67
61
  ERR_ROOM_USER_FULL = 100008,
@@ -79,13 +73,7 @@ declare enum TUIErrorCode {
79
73
  ERR_BATTLE_ID_NOT_EXIST = 100411,
80
74
  ERR_ROOM_BATTLEID_IN_OTHER = 100415,
81
75
  ERR_ROOM_METADATA_EXCEED_KEY_COUNT_LIMIT = 100500,
82
- ERR_ROOM_METADATA_EXCEED_VALUE_SIZE_LIMIT = 100501,
83
- ERR_GIFT_ABILITY_NOT_ENABLED = 102001,
84
- ERR_GIFT_NOT_EXIST = 102002,
85
- ERR_GIFT_SERVER_PRE_VERIFICATION_FAILED = 102004,
86
- ERR_MIX_STREAM_UPDATE_TOO_FREQ = 100427,
87
- ERR_PUBLISH_STREAM_INFO_NOT_EXISTED = 100430,
88
- ERR_PUBLISH_STREAM_NO_NEED_RECOVERY = 100431
76
+ ERR_ROOM_METADATA_EXCEED_VALUE_SIZE_LIMIT = 100501
89
77
  }
90
78
  type TUIRoomInfo = {
91
79
  roomId: string;
@@ -224,10 +212,7 @@ declare enum TUIChangeReason {
224
212
  declare enum TUIKickedOutOfRoomReason {
225
213
  kKickedByAdmin = 0,
226
214
  kKickedByLoggedOnOtherDevice = 1,
227
- kKickedByServer = 2,
228
- kNetworkDisconnected = 3,
229
- kJoinRoomStatusInvalidDuringOffline = 4,
230
- kCountOfJoinedRoomsExceedLimit = 5
215
+ kKickedByServer = 2
231
216
  }
232
217
  declare enum TUIRequestAction {
233
218
  kInvalidAction = 0,
@@ -277,7 +262,7 @@ type TUISeatInfo = {
277
262
  userName: string;
278
263
  nameCard: string;
279
264
  avatarUrl: string;
280
- isLocked: boolean;
265
+ locked: boolean;
281
266
  isVideoLocked: boolean;
282
267
  isAudioLocked: boolean;
283
268
  };
@@ -770,40 +755,32 @@ declare enum TUIRoomEvents {
770
755
  */
771
756
  onRequestProcessed = "onRequestProcessed",
772
757
  /**
773
- * @since v3.1.0
774
758
  * @description 接收文本消息事件
759
+ * @deprecated 该接口自 v2.0.0 版本废弃,请使用 tim 实例监听收消息事件
775
760
  * @default 'onReceiveTextMessage'
776
761
  * @event TUIRoomEvents#onReceiveTextMessage
777
- * @param {object} options 接收的文本消息
762
+ * @param {object} options
778
763
  * @param {string} options.roomId 房间Id
779
- * @param {string} options.textContent 文本消息内容
780
- * @param {TUIUserInfo} options.sender 发送者信息
781
- * @param {number} options.sequence 消息序号
782
- * @param {object} options.extensionInfo 扩展信息
783
- * @param {string} options.timestampInSecond 时间戳
764
+ * @param {TUIMessage} options.message 接收的文本消息
784
765
  * @example
785
766
  * const roomEngine = new TUIRoomEngine();
786
- * roomEngine.on(TUIRoomEvents.onReceiveTextMessage, (message) => {
787
- * console.log('roomEngine.onReceiveTextMessage', message);
767
+ * roomEngine.on(TUIRoomEvents.onReceiveTextMessage, ({ roomId, message }) => {
768
+ * console.log('roomEngine.onReceiveTextMessage', roomId, message);
788
769
  * });
789
770
  */
790
771
  onReceiveTextMessage = "onReceiveTextMessage",
791
772
  /**
792
- * @since v3.1.0
793
773
  * @description 接收自定义消息事件
774
+ * @deprecated 该接口自 v2.0.0 版本废弃,请使用 tim 实例监听收消息事件
794
775
  * @default 'onReceiveCustomMessage'
795
776
  * @event TUIRoomEvents#onReceiveCustomMessage
796
- * @param {object} options 接收的自定义消息
777
+ * @param {object} options
797
778
  * @param {string} options.roomId 房间Id
798
- * @param {string} options.businessId 业务Id
799
- * @param {string} options.data 自定义消息内容
800
- * @param {TUIUserInfo} options.sender 发送者信息
801
- * @param {number} options.sequence 消息序号
802
- * @param {string} options.timestampInSecond 时间戳
779
+ * @param {TUIMessage} options.message 接收的自定义消息
803
780
  * @example
804
781
  * const roomEngine = new TUIRoomEngine();
805
- * roomEngine.on(TUIRoomEvents.onReceiveCustomMessage, (message) => {
806
- * console.log('roomEngine.onReceiveCustomMessage', message);
782
+ * roomEngine.on(TUIRoomEvents.onReceiveCustomMessage, ({ roomId, message }) => {
783
+ * console.log('roomEngine.onReceiveCustomMessage', roomId, message);
807
784
  * });
808
785
  */
809
786
  onReceiveCustomMessage = "onReceiveCustomMessage",
@@ -843,18 +820,7 @@ declare enum TUIRoomEvents {
843
820
  * // 自动播放失败,引导用户与页面进行交互
844
821
  * });
845
822
  */
846
- onAutoPlayFailed = "onAutoPlayFailed",
847
- /**
848
- * @description 房间自定义信息改变的事件
849
- * @default 'onRoomMetadataChanged'
850
- * @event TUIRoomEvents#onRoomMetadataChanged
851
- * @example
852
- * const roomEngine = new TUIRoomEngine();
853
- * roomEngine.on(TUIRoomEvents.onRoomMetadataChanged, ({key, value}) => {
854
- * console.log(key, value);
855
- * });
856
- */
857
- onRoomMetadataChanged = "onRoomMetadataChanged"
823
+ onAutoPlayFailed = "onAutoPlayFailed"
858
824
  }
859
825
  declare enum TUIRoomDeviceMangerEvents {
860
826
  /**
@@ -1182,43 +1148,15 @@ declare enum TUIConferenceInvitationManagerEvents {
1182
1148
  onInvitationStatusChanged = "onInvitationStatusChanged"
1183
1149
  }
1184
1150
  type TUILiveInfo = {
1185
- roomId: string;
1186
- roomType: TUIRoomType;
1187
- name: string;
1188
- notice: string;
1189
- isMessageDisableForAllUser: boolean;
1151
+ basicRoomInfo: TUIRoomInfo;
1190
1152
  isGiftEnabled: boolean;
1191
1153
  isLikeEnabled: boolean;
1192
1154
  isPublicVisible: boolean;
1193
- isSeatEnabled: boolean;
1194
- keepOwnerOnSeat: boolean;
1195
- seatLayoutTemplateId: number;
1196
- maxSeatCount: number;
1197
- seatMode: TUISeatMode;
1155
+ activityStatus: number;
1156
+ viewCount: number;
1198
1157
  coverUrl: string;
1199
1158
  backgroundUrl: string;
1200
1159
  categoryList: Array<number>;
1201
- activityStatus: number;
1202
- readonly roomOwner?: string;
1203
- readonly ownerName?: string;
1204
- readonly ownerAvatarUrl?: string;
1205
- readonly createTime?: number;
1206
- readonly totalViewers?: number;
1207
- readonly isUnlimitedRoomEnabled?: boolean;
1208
- readonly cdnStreamUrl?: string;
1209
- readonly lebSecretKey?: string;
1210
- readonly lebEncrypted?: string;
1211
- readonly lebSignature?: string;
1212
- };
1213
- /**
1214
- * 直播连线用户信息
1215
- */
1216
- type TUILiveConnectionUser = {
1217
- roomId: string;
1218
- userId: string;
1219
- userName: string;
1220
- avatarUrl: string;
1221
- joinConnectionTime: number;
1222
1160
  };
1223
1161
  type TUILiveModifyInfo = {
1224
1162
  roomId: string;
@@ -1227,26 +1165,20 @@ type TUILiveModifyInfo = {
1227
1165
  coverUrl?: string;
1228
1166
  backgroundUrl?: string;
1229
1167
  categoryList?: Array<number>;
1230
- seatLayoutTemplateId?: number;
1231
1168
  };
1232
1169
  declare enum TUILiveModifyFlag {
1233
1170
  kNone = 0,
1234
- kName = 1,
1235
- kNotice = 2,
1236
- kDisableMessage = 4,
1237
- kEnableGift = 8,
1238
- kEnableLike = 16,
1239
- kPublic = 32,
1240
- kTakeSeatMode = 64,
1241
- kCoverUrl = 128,
1242
- kBackgroundUrl = 256,
1243
- kCategory = 512,
1244
- kActivityStatus = 1024,
1245
- kSeatLayoutTemplateId = 2048
1171
+ kActivityStatus = 256,
1172
+ kCoverUrl = 512,
1173
+ kCategory = 1024,
1174
+ kEnableGift = 2048,
1175
+ kEnableLike = 4096,
1176
+ kPublic = 8192,
1177
+ kBackgroundUrl = 262144
1246
1178
  }
1247
1179
  type TUILiveListResult = {
1248
1180
  cursor: string;
1249
- liveInfoList: Array<TUILiveInfo>;
1181
+ listInfoList: Array<TUILiveInfo>;
1250
1182
  };
1251
1183
  /**
1252
1184
  * @since v2.9.0
@@ -1279,413 +1211,7 @@ declare enum TUILiveLayoutManagerEvents {
1279
1211
  * };
1280
1212
  * liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
1281
1213
  */
1282
- onLiveVideoLayoutChanged = "onLiveVideoLayoutChanged",
1283
- /**
1284
- * @description 麦位排版信息发生变化事件回调
1285
- * @since v3.3.0
1286
- * @default 'onSeatLayoutChanged'
1287
- * @event TUILiveLayoutManagerEvents#onSeatLayoutChanged
1288
- * @param {object} option
1289
- * @param {string} option.roomId 房间 ID
1290
- * @param {TUISeatLayout} option.seatLayout 麦位排版信息
1291
- *
1292
- * @example
1293
- * const roomEngine = new TUIRoomEngine();
1294
- * const liveLayoutManager = roomEngine.getLiveLayoutManager();
1295
- * const callback = ({ roomId, seatLayout }) => {
1296
- * console.log('liveLayoutManager.onSeatLayoutChanged', roomId, seatLayout);
1297
- * });
1298
- * liveLayoutManager.on(TUILiveLayoutManagerEvents.onSeatLayoutChanged, callback);
1299
- */
1300
- onSeatLayoutChanged = "onSeatLayoutChanged"
1301
- }
1302
- /** 麦上用户的媒体状态信息
1303
- * @typedef {object} TUIDeviceStatus
1304
- * @property {number} TUIDeviceStatusOpened 当前设备处于打开状态
1305
- * @property {number} TUIDeviceStatusClosedBySelf 当前设备处于关闭状态,且是用户主动关闭
1306
- * @property {number} TUIDeviceStatusClosedByAdmin 当前设备处于关闭状态,且是被房主/管理员强制关闭
1307
- */
1308
- declare enum TUIDeviceStatus {
1309
- TUIDeviceStatusOpened = 0,
1310
- TUIDeviceStatusClosedBySelf = 1,
1311
- TUIDeviceStatusClosedByAdmin = 2
1312
- }
1313
- /**
1314
- * 麦位排版信息
1315
- * @typedef {object} TUISeatRegion
1316
- * @property {string} roomId 直播间 ID
1317
- * @property {number} seatIndex 麦位序号
1318
- * @property {boolean} isSeatLocked 是否被锁定
1319
- * @property {string} userId 用户 ID
1320
- * @property {string} userName 用户名称
1321
- * @property {string} userAvatar 用户头像
1322
- * @property {TUIDeviceStatus} userMicrophoneStatus 用户麦克风状态
1323
- * @property {TUIDeviceStatus} userCameraStatus 用户摄像头状态
1324
- * @property {number} x 麦位 X 坐标
1325
- * @property {number} y 麦位 Y 坐标
1326
- * @property {number} width 麦位宽度
1327
- * @property {number} height 麦位高度
1328
- * @property {number} zorder 麦位 Z 轴顺序
1329
- */
1330
- type TUISeatRegion = {
1331
- roomId: string;
1332
- seatIndex: number;
1333
- isSeatLocked: boolean;
1334
- userId: string;
1335
- userName: string;
1336
- userAvatar: string;
1337
- userMicrophoneStatus: TUIDeviceStatus;
1338
- userCameraStatus: TUIDeviceStatus;
1339
- x: number;
1340
- y: number;
1341
- width: number;
1342
- height: number;
1343
- zorder: number;
1344
- };
1345
- /**
1346
- * 直播间麦位排版
1347
- * @typedef {object} TUISeatLayout
1348
- * @property {number} templateId 麦位排版模板 ID
1349
- * @property {number} canvasWidth 麦位排版画布宽度
1350
- * @property {number} canvasHeight 麦位排版画布高度
1351
- * @property {Array<TUISeatRegion>} regions 麦位排版区域列表
1352
- */
1353
- type TUISeatLayout = {
1354
- templateId: number;
1355
- canvasWidth: number;
1356
- canvasHeight: number;
1357
- regions: Array<TUISeatRegion>;
1358
- };
1359
- /**
1360
- * 直播间统计信息
1361
- * @typedef {object} TUILiveStatisticsData
1362
- * @property {number} totalViewers 观众人数
1363
- * @property {number} totalGiftsSent 礼物发送总数
1364
- * @property {number} totalGiftCoins 礼物总价值
1365
- * @property {number} totalUniqueGiftSenders 礼物发送者总数
1366
- * @property {number} totalLikesReceived 点赞总数
1367
- */
1368
- type TUILiveStatisticsData = {
1369
- totalViewers: number;
1370
- totalGiftsSent: number;
1371
- totalGiftCoins: number;
1372
- totalUniqueGiftSenders: number;
1373
- totalLikesReceived: number;
1374
- };
1375
- /**
1376
- * @since v3.0.5
1377
- * **TUILiveConnectionManager** 事件列表<br>
1378
- */
1379
- declare enum TUILiveConnectionManagerEvents {
1380
- /**
1381
- * @description 接收到连线请求的监听事件
1382
- * @default 'onConnectionRequestReceived'
1383
- * @event TUILiveConnectionManagerEvents#onConnectionRequestReceived
1384
- * @param {object} options
1385
- * @param {TUILiveConnectionUser} options.inviter 连线邀请者
1386
- * @param {Array<TUILiveConnectionUser>} options.inviteeList 连线被邀请者列表
1387
- * @param {string} options.extensionInfo 扩展信息
1388
- *
1389
- * @example
1390
- * const roomEngine = new TUIRoomEngine();
1391
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1392
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReceived, ({ inviter, inviteeList, extensionInfo }) => {
1393
- * console.log('liveConnectionManager.onConnectionRequestReceived', inviter, inviteeList, extensionInfo);
1394
- * });
1395
- */
1396
- onConnectionRequestReceived = "onConnectionRequestReceived",
1397
- /**
1398
- * @description 连线房间主播人数变更的监听事件
1399
- * @default 'onConnectionUserListChanged'
1400
- * @event TUILiveConnectionManagerEvents#onConnectionUserListChanged
1401
- * @param {object} options
1402
- * @param {Array<TUILiveConnectionUser>} options.connectedList 包含连线房间所有主播列表
1403
- * @param {Array<TUILiveConnectionUser>} options.joinedList 本次事件变更加入连线房间的主播列表
1404
- * @param {Array<TUILiveConnectionUser>} options.leavedList 本次事件变更离开连线房间的主播列表
1405
- *
1406
- * @example
1407
- * const roomEngine = new TUIRoomEngine();
1408
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1409
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionUserListChanged, ({ connectedList, joinedList, leavedList }) => {
1410
- * console.log('liveConnectionManager.onConnectionUserListChanged', connectedList, joinedList, leavedList);
1411
- * });
1412
- */
1413
- onConnectionUserListChanged = "onConnectionUserListChanged",
1414
- /**
1415
- * @description 连线请求被取消的监听事件
1416
- * @default 'onConnectionRequestCancelled'
1417
- * @event TUILiveConnectionManagerEvents#onConnectionRequestCancelled
1418
- * @param {object} options
1419
- * @param {TUILiveConnectionUser} options.inviter 连线邀请者
1420
- *
1421
- * @example
1422
- * const roomEngine = new TUIRoomEngine();
1423
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1424
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestCancelled, ({ inviter }) => {
1425
- * console.log('liveConnectionManager.onConnectionRequestCancelled', inviter);
1426
- * });
1427
- */
1428
- onConnectionRequestCancelled = "onConnectionRequestCancelled",
1429
- /**
1430
- * @description 连线请求被同意的监听事件
1431
- * @default 'onConnectionRequestAccept'
1432
- * @event TUILiveConnectionManagerEvents#onConnectionRequestAccept
1433
- * @param {object} options
1434
- * @param {TUILiveConnectionUser} options.invitee 连线被邀请者
1435
- *
1436
- * @example
1437
- * const roomEngine = new TUIRoomEngine();
1438
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1439
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestAccept, ({ invitee }) => {
1440
- * console.log('liveConnectionManager.onConnectionRequestAccept', invitee);
1441
- * });
1442
- */
1443
- onConnectionRequestAccept = "onConnectionRequestAccept",
1444
- /**
1445
- * @description 连线请求被拒绝的监听事件
1446
- * @default 'onConnectionRequestReject'
1447
- * @event TUILiveConnectionManagerEvents#onConnectionRequestReject
1448
- * @param {object} options
1449
- * @param {TUILiveConnectionUser} options.invitee 连线被邀请者
1450
- *
1451
- * @example
1452
- * const roomEngine = new TUIRoomEngine();
1453
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1454
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReject, ({ invitee }) => {
1455
- * console.log('liveConnectionManager.onConnectionRequestReject', invitee);
1456
- * });
1457
- */
1458
- onConnectionRequestReject = "onConnectionRequestReject",
1459
- /**
1460
- * @description 邀请超时的监听事件
1461
- * @default 'onConnectionRequestTimeout'
1462
- * @event TUILiveConnectionManagerEvents#onConnectionRequestTimeout
1463
- * @param {object} option
1464
- * @param {TUILiveConnectionUser} option.inviter 连线邀请者
1465
- * @param {TUILiveConnectionUser} option.invitee 连线被邀请者
1466
- *
1467
- * @example
1468
- * const roomEngine = new TUIRoomEngine();
1469
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
1470
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestTimeout, ({ invitee, inviter }) => {
1471
- * console.log('liveConnectionManager.onConnectionRequestTimeout', invitee, inviter);
1472
- * });
1473
- */
1474
- onConnectionRequestTimeout = "onConnectionRequestTimeout"
1475
- }
1476
- /**
1477
- * 直播连线配置信息
1478
- */
1479
- type TUIBattleConfig = {
1480
- duration: number;
1481
- needResponse?: boolean;
1482
- extensionInfo?: string;
1483
- };
1484
- /**
1485
- * 直播PK用户信息
1486
- */
1487
- type TUIBattleUser = {
1488
- roomId: string;
1489
- userId: string;
1490
- userName: string;
1491
- avatarUrl: string;
1492
- score: number;
1493
- };
1494
- /**
1495
- * 直播PK信息
1496
- */
1497
- type TUIBattleInfo = {
1498
- fromUser: TUIBattleUser;
1499
- toUserList: Array<TUIBattleUser>;
1500
- extensionInfo: string;
1501
- battleId: string;
1502
- needResponse: boolean;
1503
- duration: number;
1504
- startTime: number;
1505
- endTime: number;
1506
- };
1507
- declare enum TUIBattleStoppedReason {
1508
- kStoppedByTimeOver = 0,
1509
- kStoppedByOtherExit = 1
1510
- }
1511
- declare enum TUIBattleCode {
1512
- kUnknown = -1,
1513
- kSuccess = 0,
1514
- kRoomNotExist = 1,
1515
- kBattling = 2,
1516
- kBattlingOtherRoom = 3,
1517
- kRoomExit = 4,
1518
- kRetry = 5
1519
- }
1520
- /**
1521
- * @since v3.3.0
1522
- * **TUILiveBattleManager** 事件列表<br>
1523
- */
1524
- declare enum TUILiveBattleManagerEvents {
1525
- /**
1526
- * @description 接收到PK开始的监听事件
1527
- * @default 'onBattleStarted'
1528
- * @event TUILiveBattleManagerEvents#onBattleStarted
1529
- * @param {object} options
1530
- * @param {TUIBattleInfo} battleInfo PK信息
1531
- *
1532
- * @example
1533
- * const roomEngine = new TUIRoomEngine();
1534
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1535
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleStarted, ({ battleInfo }) => {
1536
- * console.log('liveBattleManager.onBattleStarted', battleInfo);
1537
- * });
1538
- */
1539
- onBattleStarted = "onBattleStarted",
1540
- /**
1541
- * @description 接收到PK结束的监听事件
1542
- * @default 'onBattleEnded'
1543
- * @event TUILiveBattleManagerEvents#onBattleEnded
1544
- * @param {object} options
1545
- * @param {TUIBattleInfo} battleInfo PK信息
1546
- * @param {TUIBattleStoppedReason} reason PK结束原因
1547
- *
1548
- * @example
1549
- * const roomEngine = new TUIRoomEngine();
1550
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1551
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleEnded, ({ battleInfo, reason }) => {
1552
- * console.log('liveBattleManager.onBattleEnded', battleInfo, reason);
1553
- * });
1554
- */
1555
- onBattleEnded = "onBattleEnded",
1556
- /**
1557
- * @description 接收到用户加入PK的监听事件
1558
- * @default 'onUserJoinBattle'
1559
- * @event TUILiveBattleManagerEvents#onUserJoinBattle
1560
- * @param {object} options
1561
- * @param {String} battleId PK的Id
1562
- * @param {TUIBattleUser} user PK用户信息
1563
- *
1564
- * @example
1565
- * const roomEngine = new TUIRoomEngine();
1566
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1567
- * liveBattleManager.on(TUILiveBattleManagerEvents.onUserJoinBattle, ({ battleId, user }) => {
1568
- * console.log('liveBattleManager.onUserJoinBattle', battleId, user);
1569
- * });
1570
- */
1571
- onUserJoinBattle = "onUserJoinBattle",
1572
- /**
1573
- * @description 接收到用户退出PK的监听事件
1574
- * @default 'onUserExitBattle'
1575
- * @event TUILiveBattleManagerEvents#onUserExitBattle
1576
- * @param {object} options
1577
- * @param {String} battleId PK的Id
1578
- * @param {TUIBattleUser} user PK用户信息
1579
- *
1580
- * @example
1581
- * const roomEngine = new TUIRoomEngine();
1582
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1583
- * liveBattleManager.on(TUILiveBattleManagerEvents.onUserExitBattle, ({ battleId, user }) => {
1584
- * console.log('liveBattleManager.onUserExitBattle', battleId, user);
1585
- * });
1586
- */
1587
- onUserExitBattle = "onUserExitBattle",
1588
- /**
1589
- * @description 接收到PK分数变化的监听事件
1590
- * @default 'onBattleScoreChanged'
1591
- * @event TUILiveBattleManagerEvents#onBattleScoreChanged
1592
- * @param {object} options
1593
- * @param {String} battleId PK的Id
1594
- * @param {Array<TUIBattleUser>} battleUserList PK用户信息列表
1595
- *
1596
- * @example
1597
- * const roomEngine = new TUIRoomEngine();
1598
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1599
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleScoreChanged, ({ battleId, battleUserList }) => {
1600
- * console.log('liveBattleManager.onBattleScoreChanged', battleId, battleUserList);
1601
- * });
1602
- */
1603
- onBattleScoreChanged = "onBattleScoreChanged",
1604
- /**
1605
- * @description 接收PK请求的监听事件
1606
- * @default 'onBattleRequestReceived'
1607
- * @event TUILiveBattleManagerEvents#onBattleRequestReceived
1608
- * @param {object} options
1609
- * @param {TUIBattleInfo} battleInfo PK信息
1610
- * @param {TUIBattleUser} inviter 发起PK请求的用户
1611
- * @param {TUIBattleUser} invitee 接收PK请求的用户
1612
- *
1613
- * @example
1614
- * const roomEngine = new TUIRoomEngine();
1615
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1616
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleRequestReceived, ({ battleInfo, inviter, invitee }) => {
1617
- * console.log('liveBattleManager.onBattleRequestReceived', battleInfo, inviter, invitee);
1618
- * });
1619
- */
1620
- onBattleRequestReceived = "onBattleRequestReceived",
1621
- /**
1622
- * @description 接收PK请求取消的监听事件
1623
- * @default 'onBattleRequestCancelled'
1624
- * @event TUILiveBattleManagerEvents#onBattleRequestCancelled
1625
- * @param {object} options
1626
- * @param {TUIBattleInfo} battleInfo PK信息
1627
- * @param {TUIBattleUser} inviter 发起PK请求的用户
1628
- * @param {TUIBattleUser} invitee 接收PK请求的用户
1629
- *
1630
- * @example
1631
- * const roomEngine = new TUIRoomEngine();
1632
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1633
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleRequestCancelled, ({ battleInfo, inviter, invitee }) => {
1634
- * console.log('liveBattleManager.onBattleRequestCancelled', battleInfo, inviter, invitee);
1635
- * });
1636
- */
1637
- onBattleRequestCancelled = "onBattleRequestCancelled",
1638
- /**
1639
- * @description 接收PK请求超时的监听事件
1640
- * @default 'onBattleRequestTimeout'
1641
- * @event TUILiveBattleManagerEvents#onBattleRequestTimeout
1642
- * @param {object} options
1643
- * @param {TUIBattleInfo} battleInfo PK信息
1644
- * @param {TUIBattleUser} inviter 发起PK请求的用户
1645
- * @param {TUIBattleUser} invitee 接收PK请求的用户
1646
- *
1647
- * @example
1648
- * const roomEngine = new TUIRoomEngine();
1649
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1650
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleRequestTimeout, ({ battleInfo, inviter, invitee }) => {
1651
- * console.log('liveBattleManager.onBattleRequestTimeout', battleInfo, inviter, invitee);
1652
- * });
1653
- */
1654
- onBattleRequestTimeout = "onBattleRequestTimeout",
1655
- /**
1656
- * @description 接收PK请求接受的监听事件
1657
- * @default 'onBattleRequestAccept'
1658
- * @event TUILiveBattleManagerEvents#onBattleRequestAccept
1659
- * @param {object} options
1660
- * @param {TUIBattleInfo} battleInfo PK信息
1661
- * @param {TUIBattleUser} inviter 发起PK请求的用户
1662
- * @param {TUIBattleUser} invitee 接收PK请求的用户
1663
- *
1664
- * @example
1665
- * const roomEngine = new TUIRoomEngine();
1666
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1667
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleRequestAccept, ({ battleInfo, inviter, invitee }) => {
1668
- * console.log('liveBattleManager.onBattleRequestAccept', battleInfo, inviter, invitee);
1669
- * });
1670
- */
1671
- onBattleRequestAccept = "onBattleRequestAccept",
1672
- /**
1673
- * @description 接收PK请求被拒绝的监听事件
1674
- * @default 'onBattleRequestReject'
1675
- * @event TUILiveBattleManagerEvents#onBattleRequestReject
1676
- * @param {object} options
1677
- * @param {TUIBattleInfo} battleInfo PK信息
1678
- * @param {TUIBattleUser} inviter 发起PK请求的用户
1679
- * @param {TUIBattleUser} invitee 接收PK请求的用户
1680
- *
1681
- * @example
1682
- * const roomEngine = new TUIRoomEngine();
1683
- * const liveBattleManager = roomEngine.TUILiveBattleManager();
1684
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleRequestReject, ({ battleInfo, inviter, invitee }) => {
1685
- * console.log('liveBattleManager.onBattleRequestReject', battleInfo, inviter, invitee);
1686
- * });
1687
- */
1688
- onBattleRequestReject = "onBattleRequestReject"
1214
+ onLiveVideoLayoutChanged = "onLiveVideoLayoutChanged"
1689
1215
  }
1690
1216
 
1691
1217
  declare class Logger {
@@ -1722,8 +1248,8 @@ declare class TUIRoomDeviceManager {
1722
1248
  Module: any;
1723
1249
  logger: Logger;
1724
1250
  trtcCloud: TRTCCloud;
1725
- deviceManagerWASM: any;
1726
1251
  });
1252
+ setDeviceManagerWASM(deviceManagerWASM: any): void;
1727
1253
  /**
1728
1254
  * @private
1729
1255
  * 调用 TUIRoomEngineWASM 的异步方法
@@ -2276,7 +1802,6 @@ declare class TUIConferenceInvitationManager {
2276
1802
  * @class TUILiveListManager
2277
1803
  */
2278
1804
  declare class TUILiveListManager {
2279
- private roomEngineWASM;
2280
1805
  private liveListManagerWASM;
2281
1806
  private logger;
2282
1807
  private static liveListManager;
@@ -2285,124 +1810,6 @@ declare class TUILiveListManager {
2285
1810
  logger: Logger;
2286
1811
  roomEngineWASM: any;
2287
1812
  });
2288
- /**
2289
- * 开始直播
2290
- *
2291
- * @description 创建并开始一个新的直播间,房主调用此接口来启动直播
2292
- * @since 3.3.0
2293
- * @param {TUILiveInfo} liveInfo 直播间信息,包含房间ID、名称、公告等配置
2294
- * @returns {Promise<TUILiveInfo>} 返回创建成功后的直播间完整信息,包含CDN流地址等
2295
- * @throws {TUIError} 可能抛出的错误:
2296
- * - ERR_ALREADY_ROOM_OWNER: 用户已经是房间所有者
2297
- * - ERR_INVALID_PARAMETER: 传入的参数不合法
2298
- * - ERR_LIVE_SERVER_PROCESS_FAILED: 服务器处理请求失败
2299
- * @example
2300
- * ```typescript
2301
- * const liveInfo = {
2302
- * roomId: '123',
2303
- * roomType: TUIRoomType.kLivingRoom,
2304
- * name: 'ABC',
2305
- * notice: 'this is a description',
2306
- * isSeatEnabled: true,
2307
- * seatMode: TUISeatMode.kApplyToTake,
2308
- * seatLayoutTemplateId: 200,
2309
- * coverUrl: '',
2310
- * backgroundUrl: '',
2311
- * categoryList: [],
2312
- * activityStatus: 1,
2313
- * isMessageDisableForAllUser: false,
2314
- * isGiftEnabled: false,
2315
- * isLikeEnabled: false,
2316
- * isPublicVisible: false,
2317
- * keepOwnerOnSeat: false,
2318
- * };
2319
- * const roomEngine = new TUIRoomEngine();
2320
- * const liveListManager = roomEngine.getLiveListManager();
2321
- * const resultLiveInfo = await liveListManager.startLive(liveInfo);
2322
- * console.log('直播开始成功,CDN流地址:', resultLiveInfo.cdnStreamUrl);
2323
- * ```
2324
- */
2325
- startLive(liveInfo: TUILiveInfo): Promise<TUILiveInfo>;
2326
- /**
2327
- * 停止直播
2328
- *
2329
- * @description 结束当前正在进行的直播,只有房主可以调用此接口停止直播
2330
- * @since 3.3.0
2331
- * @returns {Promise<TUILiveStatisticsData>} 返回直播统计数据,包含观众人数、礼物数量、点赞数等信息
2332
- * @throws {TUIError} 可能抛出的错误:
2333
- * - ERR_DESTROY_ROOM_NO_PERMISSION: 没有权限停止直播(仅房主可操作)
2334
- * - ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM: 需要进房后才可使用此功能
2335
- * - ERR_LIVE_SERVER_PROCESS_FAILED: 服务器处理请求失败
2336
- * @example
2337
- * ```typescript
2338
- * try {
2339
- * const roomEngine = new TUIRoomEngine();
2340
- * const liveListManager = roomEngine.getLiveListManager();
2341
- * const statistics = await liveListManager.stopLive();
2342
- * console.log('直播结束,统计数据:', {
2343
- * 观众人数: statistics.totalViewers,
2344
- * 礼物总数: statistics.totalGiftsSent,
2345
- * 点赞总数: statistics.totalLikesReceived
2346
- * });
2347
- * } catch (error) {
2348
- * console.error('停止直播失败:', error);
2349
- * }
2350
- * ```
2351
- */
2352
- stopLive(): Promise<TUILiveStatisticsData>;
2353
- /**
2354
- * 加入直播
2355
- *
2356
- * @description 观众加入指定的直播间,开始观看直播内容
2357
- * @since 3.3.0
2358
- * @param {string} roomId 要加入的直播间ID
2359
- * @returns {Promise<TUILiveInfo>} 返回加入成功后的直播间信息,包含直播间名称、公告等详细信息
2360
- * @throws {TUIError} 可能抛出的错误:
2361
- * - ERR_ALREADY_ROOM_ENTER: 用户已经进入房间,重复进入房间操作
2362
- * - ERR_INVALID_PARAMETER: 房间ID参数不合法
2363
- * - ERR_LIVE_REQUEST_SERVER_TIMEOUT: 请求服务器超时
2364
- * - ERR_LIVE_DISCONNECTED: 直播连接断开
2365
- * @example
2366
- * ```typescript
2367
- * try {
2368
- * const roomEngine = new TUIRoomEngine();
2369
- * const liveListManager = roomEngine.getLiveListManager();
2370
- * const liveInfo = await liveListManager.joinLive('live_room_123');
2371
- * console.log('成功加入直播间:', {
2372
- * 房间名称: liveInfo.name,
2373
- * 房间公告: liveInfo.notice,
2374
- * CDN流地址: liveInfo.cdnStreamUrl
2375
- * });
2376
- * } catch (error) {
2377
- * console.error('加入直播间失败:', error);
2378
- * }
2379
- * ```
2380
- */
2381
- joinLive(roomId: string): Promise<TUILiveInfo>;
2382
- /**
2383
- * 离开直播
2384
- *
2385
- * @description 观众退出当前正在观看的直播间,结束观看直播
2386
- * @since 3.3.0
2387
- * @returns {Promise<void>} 无返回值,成功离开直播间后Promise将resolve
2388
- * @throws {TUIError} 可能抛出的错误:
2389
- * - ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM: 需要进房后才可使用此功能
2390
- * - ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER: 房主不支持退房操作(房主只能停止直播)
2391
- * - ERR_LIVE_SERVER_PROCESS_FAILED: 服务器处理请求失败
2392
- * @note 如果是房主想要结束直播,应该使用 stopLive() 接口而不是 leaveLive()
2393
- * @example
2394
- * ```typescript
2395
- * try {
2396
- * const roomEngine = new TUIRoomEngine();
2397
- * const liveListManager = roomEngine.getLiveListManager();
2398
- * await liveListManager.leaveLive();
2399
- * console.log('成功离开直播间');
2400
- * } catch (error) {
2401
- * console.error('离开直播间失败:', error);
2402
- * }
2403
- * ```
2404
- */
2405
- leaveLive(): Promise<void>;
2406
1813
  /**
2407
1814
  * 修改直播间信息
2408
1815
  *
@@ -2434,7 +1841,6 @@ declare class TUILiveListManager {
2434
1841
  coverUrl?: string;
2435
1842
  isPublicVisible?: boolean;
2436
1843
  backgroundUrl?: string;
2437
- seatLayoutTemplateId?: number;
2438
1844
  }): Promise<void>;
2439
1845
  /**
2440
1846
  * 获取直播间信息
@@ -2476,35 +1882,6 @@ declare class TUILiveListManager {
2476
1882
  cursor: string;
2477
1883
  count: number;
2478
1884
  }): Promise<TUILiveListResult>;
2479
- /**
2480
- * 进房前预览视频流
2481
- * @since 3.3.0
2482
- * @param options
2483
- * @param options.roomId 房间 Id
2484
- * @param options.isMuteAudio 是否静音预览
2485
- * @param options.view 播放视频流区域
2486
- */
2487
- startPreloadVideoStream(options: {
2488
- roomId: string;
2489
- isMuteAudio: boolean;
2490
- view: string;
2491
- }): Promise<void>;
2492
- /**
2493
- * 停止预览视频流
2494
- * @since 3.3.0
2495
- * @param options
2496
- * @param options.roomId 房间 Id
2497
- */
2498
- stopPreloadVideoStream(options: {
2499
- roomId: string;
2500
- }): Promise<void>;
2501
- /**
2502
- * @private
2503
- * 调用 TUIRoomEngineWASM 的 CallAPI 方法
2504
- * @param funcName
2505
- * @param jsonString
2506
- */
2507
- private JSCallNativeCallAPIPromise;
2508
1885
  private JSCallNativeFunctionPromise;
2509
1886
  /**
2510
1887
  * 监听 TUILiveListManager 事件
@@ -2615,294 +1992,21 @@ declare class TUILiveLayoutManager {
2615
1992
  * "BackgroundColor": "0x1F212C",
2616
1993
  *
2617
1994
  * }
2618
- * ],
2619
- * // 设置最大画面,只能有一路
2620
- * "MaxUserLayout": {
2621
- * "LocationX": 0, // 以画面左上角为原点的 x 坐标
2622
- * "LocationY": 0, // 以画面左上角为原点的 y 坐标
2623
- * "ImageWidth": 1920, // 调整后的画面宽度
2624
- * "ImageHeight": 1080, // 调整后的画面高度
2625
- * "ZOrder": 0, // 层级
2626
- * "StreamType": 0, // 0为摄像头, 1为屏幕共享
2627
- * "Member_Account": "admin001",
2628
- * "BackgroundImageUrl": "ImageUrl", // 可以设置看看,可能在最大画面时候没作用
2629
- * "RoomId":"roomId",
2630
- * "BackgroundColor":"0x1F212C"
2631
- * }
1995
+ * ]
1996
+ * },
1997
+ * // 设置最大画面,只能有一路
1998
+ * "MaxUserLayout": {
1999
+ * "ZOrder": 0, //层级
2000
+ * "StreamType": 0, // 0为摄像头, 1为屏幕共享
2001
+ * "Member_Account": "admin001",
2002
+ * "BackgroundImageUrl": "ImageUrl", //可以设置看看,可能在最大画面时候没作用
2003
+ * "RoomId":"roomId",
2004
+ * "BackgroundColor":"0x1F212C"
2632
2005
  * }}');
2633
2006
  */
2634
2007
  setLiveStreamLayoutInfo(roomId: string, layoutInfo: string): Promise<void>;
2635
2008
  }
2636
2009
 
2637
- /**
2638
- * 直播连线
2639
- * @class TUILiveConnectionManager
2640
- */
2641
- declare class TUILiveConnectionManager {
2642
- private liveConnectionManagerWASM;
2643
- private logger;
2644
- private static liveConnectionManager;
2645
- constructor(options: {
2646
- Module: any;
2647
- logger: Logger;
2648
- roomEngineWASM: any;
2649
- });
2650
- /**
2651
- * 请求跨房连线
2652
- *
2653
- * @param {object} options
2654
- * @param {Array<string>} options.roomIdList 待邀请的连线房间ID列表
2655
- * @param {number} options.timeout 请求超时时间, 单位 s
2656
- * @param {string} options.extensionInfo 扩展信息, 可选, 默认为: ''
2657
- * @returns {Promise<void>}
2658
- *
2659
- * @example
2660
- * const roomEngine = new TUIRoomEngine();
2661
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2662
- * liveConnectionManager.requestConnection({
2663
- * roomIdList: ['roomId1','roomId2'],
2664
- * timeout: 10,
2665
- * extensionInfo: 'extension info'
2666
- * });
2667
- */
2668
- requestConnection(options: {
2669
- roomIdList: Array<string>;
2670
- timeout: number;
2671
- extensionInfo?: string;
2672
- }): Promise<void>;
2673
- /**
2674
- * 取消跨房连线请求
2675
- *
2676
- * @param {object} options
2677
- * @param {Array<string>} options.roomIdList 被取消连线请求的房间Id列表
2678
- * @returns {Promise<void>}
2679
- *
2680
- * @example
2681
- * const roomEngine = new TUIRoomEngine();
2682
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2683
- * liveConnectionManager.cancelConnectionRequest({
2684
- * roomIdList: ['roomId1', 'roomId2']
2685
- * });
2686
- */
2687
- cancelConnectionRequest(options: {
2688
- roomIdList: Array<string>;
2689
- }): Promise<void>;
2690
- /**
2691
- * 同意连线请求
2692
- *
2693
- * @param {object} options
2694
- * @param {string} options.roomId 直播房间 ID
2695
- * @returns {Promise<void>}
2696
- *
2697
- * @example
2698
- * const roomEngine = new TUIRoomEngine();
2699
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2700
- * liveConnectionManager.acceptConnection({
2701
- * roomId: 'roomId'
2702
- * });
2703
- */
2704
- acceptConnection(options: {
2705
- roomId: string;
2706
- }): Promise<void>;
2707
- /**
2708
- * 拒绝连线请求
2709
- *
2710
- * @param {object} options
2711
- * @param {string} options.roomId 直播房间 ID
2712
- * @returns {Promise<void>}
2713
- *
2714
- * @example
2715
- * const roomEngine = new TUIRoomEngine();
2716
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2717
- * liveConnectionManager.rejectConnection({
2718
- * roomId: 'roomId'
2719
- * });
2720
- */
2721
- rejectConnection(options: {
2722
- roomId: string;
2723
- }): Promise<void>;
2724
- /**
2725
- * 断开直播连线
2726
- *
2727
- * @returns {Promise<void>}
2728
- *
2729
- * @example
2730
- * const roomEngine = new TUIRoomEngine();
2731
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2732
- * liveConnectionManager.disconnect();
2733
- */
2734
- disconnect(): Promise<void>;
2735
- private JSCallNativeFunctionPromise;
2736
- /**
2737
- * 监听 TUILiveConnectionManager 事件
2738
- * @param {TUILiveConnectionManagerEvents} event 事件名
2739
- * @param func 事件回调函数
2740
- *
2741
- * @example
2742
- * const roomEngine = new TUIRoomEngine();
2743
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2744
- * const callback = (inviter) => {
2745
- * console.log('liveConnectionManager.onConnectionRequestReceived', inviter);
2746
- * };
2747
- * liveConnectionManager.on(TUILiveConnectionManagerEvents.onLiveVideoLayoutChanged, callback);
2748
- */
2749
- on(event: TUILiveConnectionManagerEvents, func: (...args: any[]) => void): void;
2750
- /**
2751
- * 取消监听 TUILiveConnectionManager 事件
2752
- * @param {TUILiveConnectionManagerEvents} event 事件名
2753
- * @param func 事件回调函数
2754
- *
2755
- * @example
2756
- * const roomEngine = new TUIRoomEngine();
2757
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
2758
- * const callback = (inviter) => {
2759
- * console.log('liveConnectionManager.onConnectionRequestReceived', inviter);
2760
- * };
2761
- * liveConnectionManager.off(TUILiveConnectionManagerEvents.onLiveVideoLayoutChanged, callback);
2762
- */
2763
- off(event: TUILiveConnectionManagerEvents, func: (...args: any[]) => void): void;
2764
- private observerFunction;
2765
- }
2766
-
2767
- /**
2768
- * 直播PK
2769
- * @class TUILiveBattleManager
2770
- */
2771
- declare class TUILiveBattleManager {
2772
- private liveBattleManagerWASM;
2773
- private logger;
2774
- private static liveBattleManager;
2775
- constructor(options: {
2776
- Module: any;
2777
- logger: Logger;
2778
- roomEngineWASM: any;
2779
- });
2780
- /**
2781
- * 请求PK
2782
- *
2783
- * @param {object} options
2784
- * @param {TUIBattleConfig} options.config
2785
- * @param {Array<string>} options.userIdList
2786
- * @param {number} options.timeOut
2787
- * @returns {Promise<void>}
2788
- *
2789
- * @example
2790
- * const roomEngine = new TUIRoomEngine();
2791
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2792
- * liveBattleManager.requestBattle({
2793
- * config: {duration: 100, needResponse: true},
2794
- * userIdList: ['userId1'],
2795
- * timeout: 10
2796
- * });
2797
- */
2798
- requestBattle(options: {
2799
- config: TUIBattleConfig;
2800
- userIdList: Array<string>;
2801
- timeout: number;
2802
- }): Promise<any>;
2803
- /**
2804
- * 取消PK请求
2805
- *
2806
- * @param {object} options
2807
- * @param {string} options.battleId
2808
- * @param {Array<string>} options.userIdList
2809
- * @returns {Promise<void>}
2810
- *
2811
- * @example
2812
- * const roomEngine = new TUIRoomEngine();
2813
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2814
- * liveBattleManager.cancelBattleRequest({
2815
- * battleId: 'battleId',
2816
- * userIdList: ['userId1'],
2817
- * });
2818
- */
2819
- cancelBattleRequest(options: {
2820
- battleId: string;
2821
- userIdList: Array<string>;
2822
- }): Promise<void>;
2823
- /**
2824
- * 接受PK请求
2825
- *
2826
- * @param {object} options
2827
- * @param {string} options.battleId
2828
- * @returns {Promise<void>}
2829
- *
2830
- * @example
2831
- * const roomEngine = new TUIRoomEngine();
2832
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2833
- * liveBattleManager.acceptBattle({
2834
- * battleId: 'battleId',
2835
- * });
2836
- */
2837
- acceptBattle(options: {
2838
- battleId: string;
2839
- }): Promise<void>;
2840
- /**
2841
- * 拒绝PK请求
2842
- *
2843
- * @param {object} options
2844
- * @param {string} options.battleId
2845
- * @returns {Promise<void>}
2846
- *
2847
- * @example
2848
- * const roomEngine = new TUIRoomEngine();
2849
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2850
- * liveBattleManager.rejectBattle({
2851
- * battleId: 'battleId',
2852
- * });
2853
- */
2854
- rejectBattle(options: {
2855
- battleId: string;
2856
- }): Promise<void>;
2857
- /**
2858
- * 退出PK
2859
- *
2860
- * @param {object} options
2861
- * @param {string} options.battleId
2862
- * @returns {Promise<void>}
2863
- *
2864
- * @example
2865
- * const roomEngine = new TUIRoomEngine();
2866
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2867
- * liveBattleManager.exitBattle({
2868
- * battleId: 'battleId',
2869
- * });
2870
- */
2871
- exitBattle(options: {
2872
- battleId: string;
2873
- }): Promise<void>;
2874
- /**
2875
- * 监听 TUILiveBattleManager 事件
2876
- * @param {TUILiveBattleManagerEvents} event 事件名
2877
- * @param func 事件回调函数
2878
- *
2879
- * @example
2880
- * const roomEngine = new TUIRoomEngine();
2881
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2882
- * const callback = (battleInfo) => {
2883
- * console.log('liveBattleManager.onBattleStarted', battleInfo);
2884
- * };
2885
- * liveBattleManager.on(TUILiveBattleManagerEvents.onBattleStarted, callback);
2886
- */
2887
- on(event: TUILiveBattleManagerEvents, func: (...args: any[]) => void): void;
2888
- /**
2889
- * 取消监听 TUILiveBattleManager 事件
2890
- * @param {TUILiveBattleManagerEvents} event 事件名
2891
- * @param func 事件回调函数
2892
- *
2893
- * @example
2894
- * const roomEngine = new TUIRoomEngine();
2895
- * const liveBattleManager = roomEngine.getLiveBattleManager();
2896
- * const callback = (battleInfo) => {
2897
- * console.log('liveBattleManager.onBattleStarted', battleInfo);
2898
- * };
2899
- * liveBattleManager.off(TUILiveBattleManagerEvents.onBattleStarted, callback);
2900
- */
2901
- off(event: TUILiveBattleManagerEvents, func: (...args: any[]) => void): void;
2902
- private JSCallNativeFunctionPromise;
2903
- private observerFunction;
2904
- }
2905
-
2906
2010
  /**
2907
2011
  * TUIRoomEngine 提供了音视频房间的能力
2908
2012
  *
@@ -2919,8 +2023,6 @@ declare class TUIRoomEngine {
2919
2023
  private conferenceInvitationManager;
2920
2024
  private liveListManager;
2921
2025
  private liveLayoutManager;
2922
- private liveConnectionManager;
2923
- private liveBattleManager;
2924
2026
  private static userId;
2925
2027
  private static sdkAppId;
2926
2028
  private static Module;
@@ -2929,7 +2031,6 @@ declare class TUIRoomEngine {
2929
2031
  private roomId;
2930
2032
  private localVideoQuality;
2931
2033
  private localAudioQuality;
2932
- private functionWrapperMap;
2933
2034
  static setModule(Module: any): void;
2934
2035
  static once(event: string, func: (...args: any[]) => void): void;
2935
2036
  static getInstance(): TUIRoomEngine;
@@ -2949,13 +2050,6 @@ declare class TUIRoomEngine {
2949
2050
  */
2950
2051
  private JSCallNativeFunctionPromise;
2951
2052
  private JSCallNativeRequestFunctionPromise;
2952
- /**
2953
- * @private
2954
- * 调用 TUIRoomEngineWASM 的 CallAPI 方法
2955
- * @param funcName
2956
- * @param jsonString
2957
- */
2958
- private JSCallNativeCallAPIPromise;
2959
2053
  /**
2960
2054
  * 登录 TUIRoomEngine
2961
2055
  *
@@ -3052,7 +2146,6 @@ declare class TUIRoomEngine {
3052
2146
  * @param {boolean=} [options.isMessageDisableForAllUser=false] 是否允许成员发送消息,默认不禁止(创建房间可选参数)
3053
2147
  * @param {number=} options.maxSeatCount 最大麦位数量 (创建房间可选参数)
3054
2148
  * @param {string=} [options.password=''] 房间密码,(该属性自 v2.5.0 版本支持) <br>
3055
- * @param {boolean=} [options.keepOwnerOnSeat=false] 是否保持房主座位,默认不保持房主座位(该属性自 v3.1.0 版本支持)
3056
2149
  * roomType 为 TUIRoomType.kConference (教育及会议场景) 时,maxSeatCount 值不做限制;
3057
2150
  * roomType 为 TUIRoomType.kLive (直播场景) 时,maxSeatCount 最大限制为 16;
3058
2151
  * @returns {Promise<void>}
@@ -3079,7 +2172,6 @@ declare class TUIRoomEngine {
3079
2172
  isMessageDisableForAllUser?: boolean;
3080
2173
  maxSeatCount?: number;
3081
2174
  password?: string;
3082
- keepOwnerOnSeat?: boolean;
3083
2175
  }): Promise<void>;
3084
2176
  /**
3085
2177
  * 进入房间接口
@@ -3209,10 +2301,7 @@ declare class TUIRoomEngine {
3209
2301
  */
3210
2302
  getUserList(options?: {
3211
2303
  nextSequence?: number;
3212
- }): Promise<{
3213
- nextSequence: number;
3214
- userInfoList: Array<TUIUserInfo>;
3215
- }>;
2304
+ }): Promise<Array<TUIUserInfo>>;
3216
2305
  /**
3217
2306
  * 获取用户的详细信息
3218
2307
  * @param {object} options 获取用户信息的参数
@@ -3252,36 +2341,6 @@ declare class TUIRoomEngine {
3252
2341
  userId: string;
3253
2342
  customInfo: Record<string, string>;
3254
2343
  }): Promise<void>;
3255
- /**
3256
- * 设置房间的自定义信息,该接口仅主播进房后调用
3257
- * @since v3.1.0
3258
- * @param {object} options 设置房间自定义信息
3259
- * @param {string} options.metadata 自定义信息
3260
- *
3261
- * @example
3262
- * const roomEngine = new TUIRoomEngine();
3263
- * await roomEngine.setRoomMetadataByAdmin({
3264
- * metadata: JSON.stringify({key1: "value1", key2: "value2"}), // value 只能是 string
3265
- * });
3266
- */
3267
- setRoomMetadataByAdmin(options: {
3268
- metadata: string;
3269
- }): Promise<void>;
3270
- /**
3271
- * 获取房间的自定义信息
3272
- * @since v3.1.0
3273
- * @param {object} options 获取房间自定义信息
3274
- * @param {Array<string>} options.keys 自定义信息的 key 数组
3275
- *
3276
- * @example
3277
- * const roomEngine = new TUIRoomEngine();
3278
- * const result = await roomEngine.getRoomMetadata({
3279
- * keys: ["key1", "key2"] // key 只能是 string
3280
- * });
3281
- */
3282
- getRoomMetadata(options: {
3283
- keys: Array<string>;
3284
- }): Promise<any>;
3285
2344
  /**
3286
2345
  * 设置本地视频流的渲染位置
3287
2346
  * @param {object} options 设置本地视频流的渲染位置的参数
@@ -4005,42 +3064,36 @@ declare class TUIRoomEngine {
4005
3064
  */
4006
3065
  getSeatApplicationList(): Promise<TUIRequest[]>;
4007
3066
  /**
4008
- * @since v3.1.0
4009
3067
  * 发送文本消息
3068
+ * @deprecated 该接口自 v2.0.0 版本废弃,请使用 {@link getTIM} 方法获取 tim 实例发送消息
4010
3069
  * @param {object} options
4011
- * @param {string} options.textContent 文本消息内容
4012
- * @param {object} options.extensionInfo 扩展信息
3070
+ * @param {string} options.messageText 文本消息内容
4013
3071
  * @returns {Promise<void>}
4014
3072
  *
4015
3073
  * @example
4016
3074
  * const roomEngine = new TUIRoomEngine();
4017
3075
  * await roomEngine.sendTextMessage({
4018
- * textContent: 'hello, everyone',
4019
- * extensionInfo: {}
3076
+ * messageText: 'hello, everyone',
4020
3077
  * });
4021
3078
  */
4022
3079
  sendTextMessage(options: {
4023
- textContent: string;
4024
- extensionInfo: object;
3080
+ messageText: string;
4025
3081
  }): Promise<void>;
4026
3082
  /**
4027
- * @since v3.1.0
4028
3083
  * 发送自定义消息
3084
+ * @deprecated 该接口自 v2.0.0 版本废弃,请使用 {@link getTIM} 方法获取 tim 实例发送消息
4029
3085
  * @param {object} options
4030
- * @param {string} options.businessId 业务 Id
4031
- * @param {string} options.data 自定义消息内容
3086
+ * @param {string} options.messageText 自定义消息内容
4032
3087
  * @returns {Promise<void>}
4033
3088
  *
4034
3089
  * @example
4035
3090
  * const roomEngine = new TUIRoomEngine();
4036
3091
  * await roomEngine.sendCustomMessage({
4037
- * businessId: '111',
4038
- * data: '{"msg":"test"}',
3092
+ * messageText: '{ data:'', description: ''}',
4039
3093
  * });
4040
3094
  */
4041
3095
  sendCustomMessage(options: {
4042
- businessId: string;
4043
- data: string;
3096
+ messageText: string;
4044
3097
  }): Promise<void>;
4045
3098
  /**
4046
3099
  * 开始屏幕共享
@@ -4122,7 +3175,6 @@ declare class TUIRoomEngine {
4122
3175
  selectScreenSharingTarget(options: {
4123
3176
  targetId: string;
4124
3177
  } | string): Promise<void>;
4125
- private handleCatchErrorFunction;
4126
3178
  /**
4127
3179
  * 监听 roomEngine 的事件
4128
3180
  * @param event TUIRoomEvents
@@ -4282,19 +3334,12 @@ declare class TUIRoomEngine {
4282
3334
  * 开始进行麦克风测试
4283
3335
  * @param options
4284
3336
  * @param {number} options.interval 麦克风音量的回调时间
4285
- *
4286
- * @example
4287
- * const roomEngine = new TUIRoomEngine();
4288
- * await roomEngine.startMicDeviceTest({interval: 200});
4289
3337
  */
4290
3338
  startMicDeviceTest(options: {
4291
3339
  interval: number;
4292
3340
  }): Promise<void>;
4293
3341
  /**
4294
3342
  * 停止进行麦克风测试
4295
- * @example
4296
- * const roomEngine = new TUIRoomEngine();
4297
- * await roomEngine.stopMicDeviceTest();
4298
3343
  */
4299
3344
  stopMicDeviceTest(): Promise<void>;
4300
3345
  /**
@@ -4307,6 +3352,7 @@ declare class TUIRoomEngine {
4307
3352
  * @returns {TUIRoomDeviceManager} deviceManager
4308
3353
  */
4309
3354
  getMediaDeviceManager(): TUIRoomDeviceManager;
3355
+ private handleDeviceManagerWASM;
4310
3356
  /**
4311
3357
  * v2.5.0 版本起支持使用 getConferenceListManager 获取 conferenceListManager 模块
4312
3358
  * @since v2.5.0
@@ -4340,28 +3386,6 @@ declare class TUIRoomEngine {
4340
3386
  * const liveLayoutManager = roomEngine.getLiveLayoutManager();
4341
3387
  */
4342
3388
  getLiveLayoutManager(): TUILiveLayoutManager;
4343
- /**
4344
- * v3.2.0 版本起支持 getLiveConnectionManager 获取 TUILiveConnectionManager 模块
4345
- *
4346
- * @since v3.2.0
4347
- * @returns {TUILiveConnectionManager}
4348
- *
4349
- * @example
4350
- * const roomEngine = new TUIRoomEngine();
4351
- * const liveConnectionManager = roomEngine.getLiveConnectionManager();
4352
- */
4353
- getLiveConnectionManager(): TUILiveConnectionManager;
4354
- /**
4355
- * v3.3.0 版本起支持 getLiveBattleManager 获取 TUILiveBattleManager 模块
4356
- *
4357
- * @since v3.3.0
4358
- * @returns {TUILiveBattleManager}
4359
- *
4360
- * @example
4361
- * const roomEngine = new TUIRoomEngine();
4362
- * const liveBattleManager = roomEngine.getLiveBattleManager();
4363
- */
4364
- getLiveBattleManager(): TUILiveBattleManager;
4365
3389
  /**
4366
3390
  * v2.6.0 版本起支持使用 getConferenceInvitationManager 获取 conferenceInvitation 模块
4367
3391
  * @since v2.6.0
@@ -4404,4 +3428,5 @@ declare class TUIRoomEngine {
4404
3428
  private static handleSetFramework;
4405
3429
  }
4406
3430
 
4407
- export { TRTCRole, TUIAudioQuality, TUIAudioRoute, type TUIAutoPlayCallbackInfo, TUIBattleCode, type TUIBattleConfig, type TUIBattleInfo, TUIBattleStoppedReason, type TUIBattleUser, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, type TUIConferenceInfo, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, type TUIConferenceModifyInfo, TUIConferenceStatus, type TUIDeviceInfo, TUIDeviceStatus, type TUIEnterRoomOptions, TUIErrorCode, type TUIInvitation, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, TUILiveBattleManagerEvents, TUILiveConnectionManagerEvents, type TUILiveConnectionUser, type TUILiveInfo, TUILiveLayoutManager, TUILiveLayoutManagerEvents, TUILiveListManager, TUILiveListManagerEvents, type TUILiveListResult, TUILiveModifyFlag, type TUILiveModifyInfo, type TUILiveStatisticsData, type TUILoginUserInfo, TUIMediaDevice, TUIMediaDeviceState, TUIMediaDeviceType, type TUIMessage, type TUINetwork, TUINetworkQuality, type TUIRequest, TUIRequestAction, type TUIRequestCallback, TUIRequestCallbackType, TUIResolutionMode, TUIRole, TUIRoomDeviceManager, TUIRoomDeviceMangerEvents, TUIRoomDismissedReason, TUIRoomEvents, type TUIRoomInfo, TUIRoomType, type TUISeatInfo, type TUISeatLayout, type TUISeatLockParams, TUISeatMode, type TUISeatRegion, type TUIUserInfo, type TUIVideoEncoderParams, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
3431
+ export { TRTCRole, TUIAudioQuality, TUIAudioRoute, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, TUIConferenceStatus, TUIErrorCode, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, TUILiveLayoutManager, TUILiveLayoutManagerEvents, TUILiveListManager, TUILiveListManagerEvents, TUILiveModifyFlag, TUIMediaDevice, TUIMediaDeviceState, TUIMediaDeviceType, TUINetworkQuality, TUIRequestAction, TUIRequestCallbackType, TUIResolutionMode, TUIRole, TUIRoomDeviceManager, TUIRoomDeviceMangerEvents, TUIRoomDismissedReason, TUIRoomEvents, TUIRoomType, TUISeatMode, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
3432
+ export type { TUIAutoPlayCallbackInfo, TUIConferenceInfo, TUIConferenceModifyInfo, TUIDeviceInfo, TUIEnterRoomOptions, TUIInvitation, TUILiveInfo, TUILiveListResult, TUILiveModifyInfo, TUILoginUserInfo, TUIMessage, TUINetwork, TUIRequest, TUIRequestCallback, TUIRoomInfo, TUISeatInfo, TUISeatLockParams, TUIUserInfo, TUIVideoEncoderParams };