@tencentcloud/tuiroom-engine-electron 3.0.6-beta.0 → 3.2.0
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.cjs.js +2 -2
- package/index.d.ts +442 -25
- package/index.esm.js +2 -2
- package/index.js +2 -2
- package/package.json +3 -3
package/index.d.ts
CHANGED
|
@@ -212,7 +212,10 @@ declare enum TUIChangeReason {
|
|
|
212
212
|
declare enum TUIKickedOutOfRoomReason {
|
|
213
213
|
kKickedByAdmin = 0,
|
|
214
214
|
kKickedByLoggedOnOtherDevice = 1,
|
|
215
|
-
kKickedByServer = 2
|
|
215
|
+
kKickedByServer = 2,
|
|
216
|
+
kNetworkDisconnected = 3,
|
|
217
|
+
kJoinRoomStatusInvalidDuringOffline = 4,
|
|
218
|
+
kCountOfJoinedRoomsExceedLimit = 5
|
|
216
219
|
}
|
|
217
220
|
declare enum TUIRequestAction {
|
|
218
221
|
kInvalidAction = 0,
|
|
@@ -262,7 +265,7 @@ type TUISeatInfo = {
|
|
|
262
265
|
userName: string;
|
|
263
266
|
nameCard: string;
|
|
264
267
|
avatarUrl: string;
|
|
265
|
-
|
|
268
|
+
isLocked: boolean;
|
|
266
269
|
isVideoLocked: boolean;
|
|
267
270
|
isAudioLocked: boolean;
|
|
268
271
|
};
|
|
@@ -745,32 +748,40 @@ declare enum TUIRoomEvents {
|
|
|
745
748
|
*/
|
|
746
749
|
onRequestProcessed = "onRequestProcessed",
|
|
747
750
|
/**
|
|
751
|
+
* @since v3.1.0
|
|
748
752
|
* @description 接收文本消息事件
|
|
749
|
-
* @deprecated 该接口自 v2.0.0 版本废弃,请使用 tim 实例监听收消息事件
|
|
750
753
|
* @default 'onReceiveTextMessage'
|
|
751
754
|
* @event TUIRoomEvents#onReceiveTextMessage
|
|
752
|
-
* @param {object} options
|
|
755
|
+
* @param {object} options 接收的文本消息
|
|
753
756
|
* @param {string} options.roomId 房间Id
|
|
754
|
-
* @param {
|
|
757
|
+
* @param {string} options.textContent 文本消息内容
|
|
758
|
+
* @param {TUIUserInfo} options.sender 发送者信息
|
|
759
|
+
* @param {number} options.sequence 消息序号
|
|
760
|
+
* @param {object} options.extensionInfo 扩展信息
|
|
761
|
+
* @param {string} options.timestampInSecond 时间戳
|
|
755
762
|
* @example
|
|
756
763
|
* const roomEngine = new TUIRoomEngine();
|
|
757
|
-
* roomEngine.on(TUIRoomEvents.onReceiveTextMessage, (
|
|
758
|
-
* console.log('roomEngine.onReceiveTextMessage',
|
|
764
|
+
* roomEngine.on(TUIRoomEvents.onReceiveTextMessage, (message) => {
|
|
765
|
+
* console.log('roomEngine.onReceiveTextMessage', message);
|
|
759
766
|
* });
|
|
760
767
|
*/
|
|
761
768
|
onReceiveTextMessage = "onReceiveTextMessage",
|
|
762
769
|
/**
|
|
770
|
+
* @since v3.1.0
|
|
763
771
|
* @description 接收自定义消息事件
|
|
764
|
-
* @deprecated 该接口自 v2.0.0 版本废弃,请使用 tim 实例监听收消息事件
|
|
765
772
|
* @default 'onReceiveCustomMessage'
|
|
766
773
|
* @event TUIRoomEvents#onReceiveCustomMessage
|
|
767
|
-
* @param {object} options
|
|
774
|
+
* @param {object} options 接收的自定义消息
|
|
768
775
|
* @param {string} options.roomId 房间Id
|
|
769
|
-
* @param {
|
|
776
|
+
* @param {string} options.businessId 业务Id
|
|
777
|
+
* @param {string} options.data 自定义消息内容
|
|
778
|
+
* @param {TUIUserInfo} options.sender 发送者信息
|
|
779
|
+
* @param {number} options.sequence 消息序号
|
|
780
|
+
* @param {string} options.timestampInSecond 时间戳
|
|
770
781
|
* @example
|
|
771
782
|
* const roomEngine = new TUIRoomEngine();
|
|
772
|
-
* roomEngine.on(TUIRoomEvents.onReceiveCustomMessage, (
|
|
773
|
-
* console.log('roomEngine.onReceiveCustomMessage',
|
|
783
|
+
* roomEngine.on(TUIRoomEvents.onReceiveCustomMessage, (message) => {
|
|
784
|
+
* console.log('roomEngine.onReceiveCustomMessage', message);
|
|
774
785
|
* });
|
|
775
786
|
*/
|
|
776
787
|
onReceiveCustomMessage = "onReceiveCustomMessage",
|
|
@@ -799,7 +810,29 @@ declare enum TUIRoomEvents {
|
|
|
799
810
|
* console.log('roomEngine.onUserScreenCaptureStopped');
|
|
800
811
|
* });
|
|
801
812
|
*/
|
|
802
|
-
onUserScreenCaptureStopped = "onUserScreenCaptureStopped"
|
|
813
|
+
onUserScreenCaptureStopped = "onUserScreenCaptureStopped",
|
|
814
|
+
/**
|
|
815
|
+
* @description 自动播放失败的事件,监听到该事件后可以引导用户与页面进行交互
|
|
816
|
+
* @default 'onAutoPlayFailed'
|
|
817
|
+
* @event TUIRoomEvents#onAutoPlayFailed
|
|
818
|
+
* @example
|
|
819
|
+
* const roomEngine = new TUIRoomEngine();
|
|
820
|
+
* roomEngine.on(TUIRoomEvents.onAutoPlayFailed, ({userId, resume}) => {
|
|
821
|
+
* // 自动播放失败,引导用户与页面进行交互
|
|
822
|
+
* });
|
|
823
|
+
*/
|
|
824
|
+
onAutoPlayFailed = "onAutoPlayFailed",
|
|
825
|
+
/**
|
|
826
|
+
* @description 房间自定义信息改变的事件
|
|
827
|
+
* @default 'onRoomMetadataChanged'
|
|
828
|
+
* @event TUIRoomEvents#onRoomMetadataChanged
|
|
829
|
+
* @example
|
|
830
|
+
* const roomEngine = new TUIRoomEngine();
|
|
831
|
+
* roomEngine.on(TUIRoomEvents.onRoomMetadataChanged, ({key, value}) => {
|
|
832
|
+
* console.log(key, value);
|
|
833
|
+
* });
|
|
834
|
+
*/
|
|
835
|
+
onRoomMetadataChanged = "onRoomMetadataChanged"
|
|
803
836
|
}
|
|
804
837
|
declare enum TUIRoomDeviceMangerEvents {
|
|
805
838
|
/**
|
|
@@ -1157,7 +1190,7 @@ declare enum TUILiveModifyFlag {
|
|
|
1157
1190
|
}
|
|
1158
1191
|
type TUILiveListResult = {
|
|
1159
1192
|
cursor: string;
|
|
1160
|
-
|
|
1193
|
+
liveInfoList: Array<TUILiveInfo>;
|
|
1161
1194
|
};
|
|
1162
1195
|
/**
|
|
1163
1196
|
* @since v2.9.0
|
|
@@ -1181,6 +1214,17 @@ declare enum TUILiveListManagerEvents {
|
|
|
1181
1214
|
*/
|
|
1182
1215
|
onLiveInfoChanged = "onLiveInfoChanged"
|
|
1183
1216
|
}
|
|
1217
|
+
declare enum TUILiveLayoutManagerEvents {
|
|
1218
|
+
/**
|
|
1219
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1220
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
1221
|
+
* const callback = (roomId, layoutInfo) => {
|
|
1222
|
+
* console.log('liveLayoutManager.onLiveVideoLayoutListChanged', roomId, layoutInfo);
|
|
1223
|
+
* };
|
|
1224
|
+
* liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutListChanged, callback);
|
|
1225
|
+
*/
|
|
1226
|
+
onLiveVideoLayoutListChanged = "onLiveVideoLayoutListChanged"
|
|
1227
|
+
}
|
|
1184
1228
|
declare enum TUILiveLayoutManagerEvents {
|
|
1185
1229
|
/**
|
|
1186
1230
|
* const roomEngine = new TUIRoomEngine();
|
|
@@ -1191,6 +1235,130 @@ declare enum TUILiveLayoutManagerEvents {
|
|
|
1191
1235
|
* liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
1192
1236
|
*/
|
|
1193
1237
|
onLiveVideoLayoutChanged = "onLiveVideoLayoutChanged"
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* @since v3.0.5
|
|
1241
|
+
* **TUILiveConnectionManager** 事件列表<br>
|
|
1242
|
+
*/
|
|
1243
|
+
declare enum TUILiveConnectionManagerEvents {
|
|
1244
|
+
/**
|
|
1245
|
+
* @description 接收到连线请求的监听事件
|
|
1246
|
+
* @default 'onConnectionRequestReceived'
|
|
1247
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestReceived
|
|
1248
|
+
* @param {inviter} options 连线请求发起者
|
|
1249
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1250
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1251
|
+
* @param {roomId} options.roomId 房间号
|
|
1252
|
+
* @param {userId} options.userId ID
|
|
1253
|
+
* @param {userName} options.userName 用户名
|
|
1254
|
+
*
|
|
1255
|
+
* @example
|
|
1256
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1257
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1258
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReceived, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1259
|
+
* console.log('liveConnectionManager.onConnectionRequestReceived', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1260
|
+
* });
|
|
1261
|
+
*/
|
|
1262
|
+
onConnectionRequestReceived = "onConnectionRequestReceived",
|
|
1263
|
+
/**
|
|
1264
|
+
* @description 连线房间主播人数变更的监听事件
|
|
1265
|
+
* @default 'onConnectionUserListChanged'
|
|
1266
|
+
* @event TUILiveConnectionManagerEvents#onConnectionUserListChanged
|
|
1267
|
+
* @param {object} options
|
|
1268
|
+
* @param {connectedList} options.connectedList 包含连线房间所有主播列表
|
|
1269
|
+
* @param {joinedList} options.joinedList 本次事件变更加入连线房间的主播列表
|
|
1270
|
+
* @param {leavedList} options.leavedList 本次事件变更离开连线房间的主播列表
|
|
1271
|
+
*
|
|
1272
|
+
* @example
|
|
1273
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1274
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1275
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionUserListChanged, ({ connectedList, joinedList, leavedList }) => {
|
|
1276
|
+
* console.log('liveConnectionManager.onConnectionUserListChanged', connectedList, joinedList, leavedList);
|
|
1277
|
+
* });
|
|
1278
|
+
*/
|
|
1279
|
+
onConnectionUserListChanged = "onConnectionUserListChanged",
|
|
1280
|
+
/**
|
|
1281
|
+
* @description 连线请求被取消的监听事件
|
|
1282
|
+
* @default 'onConnectionRequestCancelled'
|
|
1283
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestCancelled
|
|
1284
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1285
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1286
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1287
|
+
* @param {roomId} options.roomId 房间号
|
|
1288
|
+
* @param {userId} options.userId ID
|
|
1289
|
+
* @param {userName} options.userName 用户名
|
|
1290
|
+
*
|
|
1291
|
+
* @example
|
|
1292
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1293
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1294
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestCancelled, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1295
|
+
* console.log('liveConnectionManager.onConnectionRequestCancelled', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1296
|
+
* });
|
|
1297
|
+
*/
|
|
1298
|
+
onConnectionRequestCancelled = "onConnectionRequestCancelled",
|
|
1299
|
+
/**
|
|
1300
|
+
* @description 连线请求被同意的监听事件
|
|
1301
|
+
* @default 'onConnectionRequestAccept'
|
|
1302
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestAccept
|
|
1303
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1304
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1305
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1306
|
+
* @param {roomId} options.roomId 房间号
|
|
1307
|
+
* @param {userId} options.userId ID
|
|
1308
|
+
* @param {userName} options.userName 用户名
|
|
1309
|
+
*
|
|
1310
|
+
* @example
|
|
1311
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1312
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1313
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestAccept, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1314
|
+
* console.log('liveConnectionManager.onConnectionRequestAccept', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1315
|
+
* });
|
|
1316
|
+
*/
|
|
1317
|
+
onConnectionRequestAccept = "onConnectionRequestAccept",
|
|
1318
|
+
/**
|
|
1319
|
+
* @description 连线请求被拒绝的监听事件
|
|
1320
|
+
* @default 'onConnectionRequestReject'
|
|
1321
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestReject
|
|
1322
|
+
* @param {invitee} options 连线请求被邀请者
|
|
1323
|
+
* @param {avatarUrl} options.avatarUrl 头像
|
|
1324
|
+
* @param {joinConnectionTime} options.joinConnectionTime 加入连线时间
|
|
1325
|
+
* @param {roomId} options.roomId 房间号
|
|
1326
|
+
* @param {userId} options.userId ID
|
|
1327
|
+
* @param {userName} options.userName 用户名
|
|
1328
|
+
*
|
|
1329
|
+
* @example
|
|
1330
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1331
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1332
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestReject, ({ avatarUrl, joinConnectionTime, roomId, userId, userName }) => {
|
|
1333
|
+
* console.log('liveConnectionManager.onConnectionRequestReject', avatarUrl, joinConnectionTime, roomId, userId, userName);
|
|
1334
|
+
* });
|
|
1335
|
+
*/
|
|
1336
|
+
onConnectionRequestReject = "onConnectionRequestReject",
|
|
1337
|
+
/**
|
|
1338
|
+
* @description 邀请超时的监听事件
|
|
1339
|
+
* @default 'onConnectionRequestTimeout'
|
|
1340
|
+
* @event TUILiveConnectionManagerEvents#onConnectionRequestTimeout
|
|
1341
|
+
* @param {invitee} invitee 连线请求被邀请者
|
|
1342
|
+
* @param {avatarUrl} invitee.avatarUrl 头像
|
|
1343
|
+
* @param {joinConnectionTime} invitee.joinConnectionTime 加入连线时间
|
|
1344
|
+
* @param {roomId} invitee.roomId 房间号
|
|
1345
|
+
* @param {userId} invitee.userId ID
|
|
1346
|
+
* @param {userName} invitee.userName 用户名
|
|
1347
|
+
* @param {inviter} inviter 连线请求邀请者
|
|
1348
|
+
* @param {avatarUrl} inviter.avatarUrl 头像
|
|
1349
|
+
* @param {joinConnectionTime} inviter.joinConnectionTime 加入连线时间
|
|
1350
|
+
* @param {roomId} inviter.roomId 房间号
|
|
1351
|
+
* @param {userId} inviter.userId ID
|
|
1352
|
+
* @param {userName} inviter.userName 用户名
|
|
1353
|
+
*
|
|
1354
|
+
* @example
|
|
1355
|
+
* const roomEngine = new TUIRoomEngine();
|
|
1356
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
1357
|
+
* liveConnectionManager.on(TUILiveConnectionManagerEvents.onConnectionRequestTimeout, (invitee, inviter) => {
|
|
1358
|
+
* console.log('liveConnectionManager.onConnectionRequestTimeout', invitee, inviter);
|
|
1359
|
+
* });
|
|
1360
|
+
*/
|
|
1361
|
+
onConnectionRequestTimeout = "onConnectionRequestTimeout"
|
|
1194
1362
|
}
|
|
1195
1363
|
|
|
1196
1364
|
declare class Logger {
|
|
@@ -1894,6 +2062,209 @@ declare class TUILiveListManager {
|
|
|
1894
2062
|
private handleLiveInfoChangeEvent;
|
|
1895
2063
|
}
|
|
1896
2064
|
|
|
2065
|
+
/**
|
|
2066
|
+
* 直播自定义布局插件
|
|
2067
|
+
* @class TUILiveLayoutManager
|
|
2068
|
+
*/
|
|
2069
|
+
declare class TUILiveLayoutManager {
|
|
2070
|
+
private liveLayoutManagerWASM;
|
|
2071
|
+
private logger;
|
|
2072
|
+
private static liveLayoutManager;
|
|
2073
|
+
constructor(options: {
|
|
2074
|
+
Module: any;
|
|
2075
|
+
logger: Logger;
|
|
2076
|
+
roomEngineWASM: any;
|
|
2077
|
+
});
|
|
2078
|
+
private observerFunction;
|
|
2079
|
+
private handleLiveLayoutChangeEvent;
|
|
2080
|
+
private JSCallNativeFunctionPromise;
|
|
2081
|
+
/**
|
|
2082
|
+
* 监听 TUILiveLayoutManager 事件
|
|
2083
|
+
* @param {TUILiveLayoutManagerEvents} event 事件名
|
|
2084
|
+
* @param func 事件回调函数
|
|
2085
|
+
*
|
|
2086
|
+
* @example
|
|
2087
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2088
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
2089
|
+
* const callback = (roomId, layoutInfo) => {
|
|
2090
|
+
* console.log('liveLayoutManager.onLiveVideoLayoutChanged', roomId, layoutInfo);
|
|
2091
|
+
* };
|
|
2092
|
+
* liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
2093
|
+
*/
|
|
2094
|
+
on(event: TUILiveLayoutManagerEvents, func: (...args: any[]) => void): void;
|
|
2095
|
+
/**
|
|
2096
|
+
* 取消 TUILiveLayoutManager 事件监听
|
|
2097
|
+
* @param {TUILiveLayoutManagerEvents} event 事件名
|
|
2098
|
+
* @param {Function} func 事件回调函数
|
|
2099
|
+
*
|
|
2100
|
+
* @example
|
|
2101
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2102
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
2103
|
+
* const callback = (roomId, layoutInfo) => {
|
|
2104
|
+
* console.log('liveLayoutManager.onLiveVideoLayoutChanged', roomId, layoutInfo);
|
|
2105
|
+
* };
|
|
2106
|
+
* liveLayoutManager.off(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
2107
|
+
*/
|
|
2108
|
+
off(event: TUILiveLayoutManagerEvents, func: (...args: any[]) => void): void;
|
|
2109
|
+
/**
|
|
2110
|
+
* 设置自定义布局信息
|
|
2111
|
+
*
|
|
2112
|
+
* @param {string} roomId 直播房间 ID
|
|
2113
|
+
* @param {string} layoutInfo 自定义布局信息, 格式为 JSON 字符串
|
|
2114
|
+
* @returns {Promise<void>}
|
|
2115
|
+
*
|
|
2116
|
+
* @example
|
|
2117
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2118
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
2119
|
+
* liveLayoutManager.setLiveStreamLayoutInfo('roomId', '{
|
|
2120
|
+
* // 设置画布大小
|
|
2121
|
+
* "VideoEncode": {
|
|
2122
|
+
* "Width": 1920,
|
|
2123
|
+
* "Height": 1080,
|
|
2124
|
+
* },
|
|
2125
|
+
* "LayoutMode": 0, // 0~9 内置布局模板, 1000自定义布局, 只有1000时候才能修改LayoutInfo,目前只支持 0 和 1000
|
|
2126
|
+
* // 设置画面布局
|
|
2127
|
+
* "LayoutInfo": {
|
|
2128
|
+
* "LayoutList": [
|
|
2129
|
+
* {
|
|
2130
|
+
* "LocationX": 0, // 以画面左上角为原点的 x 坐标
|
|
2131
|
+
* "LocationY": 0, // 以画面左上角为原点的 y 坐标
|
|
2132
|
+
* "ImageWidth": 1920, // 调整后的画面宽度
|
|
2133
|
+
* "ImageHeight": 1080, // 调整后的画面高度
|
|
2134
|
+
* "ZOrder": 0, // 画面层级
|
|
2135
|
+
* "StreamType": 0, // 0 摄像头, 1 屏幕共享, 2 白板, 3 自定义
|
|
2136
|
+
* "Member_Account": "admin001", // 该路流的用户ID
|
|
2137
|
+
* "BackgroundImageUrl": "ImageUrl",
|
|
2138
|
+
* "RoomId": "roomId",
|
|
2139
|
+
* "BackgroundColor": "0x1F212C",
|
|
2140
|
+
*
|
|
2141
|
+
* }
|
|
2142
|
+
* ],
|
|
2143
|
+
* // 设置最大画面,只能有一路
|
|
2144
|
+
* "MaxUserLayout": {
|
|
2145
|
+
* "LocationX": 0, // 以画面左上角为原点的 x 坐标
|
|
2146
|
+
* "LocationY": 0, // 以画面左上角为原点的 y 坐标
|
|
2147
|
+
* "ImageWidth": 1920, // 调整后的画面宽度
|
|
2148
|
+
* "ImageHeight": 1080, // 调整后的画面高度
|
|
2149
|
+
* "ZOrder": 0, // 层级
|
|
2150
|
+
* "StreamType": 0, // 0为摄像头, 1为屏幕共享
|
|
2151
|
+
* "Member_Account": "admin001",
|
|
2152
|
+
* "BackgroundImageUrl": "ImageUrl", // 可以设置看看,可能在最大画面时候没作用
|
|
2153
|
+
* "RoomId":"roomId",
|
|
2154
|
+
* "BackgroundColor":"0x1F212C"
|
|
2155
|
+
* }
|
|
2156
|
+
* }}');
|
|
2157
|
+
*/
|
|
2158
|
+
setLiveStreamLayoutInfo(roomId: string, layoutInfo: string): Promise<void>;
|
|
2159
|
+
}
|
|
2160
|
+
|
|
2161
|
+
/**
|
|
2162
|
+
* 直播连线
|
|
2163
|
+
* @class TUILiveConnectionManager
|
|
2164
|
+
*/
|
|
2165
|
+
declare class TUILiveConnectionManager {
|
|
2166
|
+
private liveConnectionManagerWASM;
|
|
2167
|
+
private logger;
|
|
2168
|
+
private static liveConnectionManager;
|
|
2169
|
+
constructor(options: {
|
|
2170
|
+
Module: any;
|
|
2171
|
+
logger: Logger;
|
|
2172
|
+
roomEngineWASM: any;
|
|
2173
|
+
});
|
|
2174
|
+
/**
|
|
2175
|
+
* 监听 TUILiveConnectionManager 事件
|
|
2176
|
+
* @param {TUILiveConnectionManagerEvents} event 事件名
|
|
2177
|
+
* @param func 事件回调函数
|
|
2178
|
+
*
|
|
2179
|
+
* @example
|
|
2180
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2181
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2182
|
+
* const callback = (inviter) => {
|
|
2183
|
+
* console.log('liveConnectionManager.onConnectionRequestReceived', inviter);
|
|
2184
|
+
* };
|
|
2185
|
+
* liveConnectionManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
2186
|
+
*/
|
|
2187
|
+
on(event: TUILiveConnectionManagerEvents, func: (...args: any[]) => void): void;
|
|
2188
|
+
/**
|
|
2189
|
+
* 取消监听 TUILiveConnectionManager 事件
|
|
2190
|
+
* @param {TUILiveConnectionManagerEvents} event 事件名
|
|
2191
|
+
* @param func 事件回调函数
|
|
2192
|
+
*
|
|
2193
|
+
* @example
|
|
2194
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2195
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2196
|
+
* const callback = (inviter) => {
|
|
2197
|
+
* console.log('liveConnectionManager.onConnectionRequestReceived', inviter);
|
|
2198
|
+
* };
|
|
2199
|
+
* liveConnectionManager.off(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
|
|
2200
|
+
*/
|
|
2201
|
+
off(event: TUILiveConnectionManagerEvents, func: (...args: any[]) => void): void;
|
|
2202
|
+
/**
|
|
2203
|
+
* 请求跨房连线
|
|
2204
|
+
*
|
|
2205
|
+
* @param {Array<string>} roomIdList 待邀请的连线房间ID列表
|
|
2206
|
+
* @param {string} timeOut 请求超时时间, 单位 s
|
|
2207
|
+
* @param {string} extensionInfo 扩展信息, 可选, 默认为: ''
|
|
2208
|
+
* @returns {Promise<void>}
|
|
2209
|
+
*
|
|
2210
|
+
* @example
|
|
2211
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2212
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2213
|
+
* liveConnectionManager.requestConnection(['roomId1','roomId2'], 10);
|
|
2214
|
+
*/
|
|
2215
|
+
requestConnection(roomIdList: Array<string>, timeOut: number, extensionInfo?: string): Promise<void>;
|
|
2216
|
+
/**
|
|
2217
|
+
* 取消跨房连线请求
|
|
2218
|
+
*
|
|
2219
|
+
* @param {Array<string>} roomIdList 被取消连线请求的房间Id列表
|
|
2220
|
+
* @returns {Promise<void>}
|
|
2221
|
+
*
|
|
2222
|
+
* @example
|
|
2223
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2224
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2225
|
+
* liveConnectionManager.cancelConnectionRequest(['roomId1', 'roomId2']);
|
|
2226
|
+
*/
|
|
2227
|
+
cancelConnectionRequest(roomIdList: Array<string>): Promise<void>;
|
|
2228
|
+
/**
|
|
2229
|
+
* 同意连线请求
|
|
2230
|
+
*
|
|
2231
|
+
* @param {string} roomId 直播房间 ID
|
|
2232
|
+
* @returns {Promise<void>}
|
|
2233
|
+
*
|
|
2234
|
+
* @example
|
|
2235
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2236
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2237
|
+
* liveConnectionManager.acceptConnection('roomId');
|
|
2238
|
+
*/
|
|
2239
|
+
acceptConnection(roomId: string): Promise<void>;
|
|
2240
|
+
/**
|
|
2241
|
+
* 拒绝连线请求
|
|
2242
|
+
*
|
|
2243
|
+
* @param {string} roomId 直播房间 ID
|
|
2244
|
+
* @returns {Promise<void>}
|
|
2245
|
+
*
|
|
2246
|
+
* @example
|
|
2247
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2248
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2249
|
+
* liveConnectionManager.rejectConnection('roomId');
|
|
2250
|
+
*/
|
|
2251
|
+
rejectConnection(roomId: string): Promise<void>;
|
|
2252
|
+
/**
|
|
2253
|
+
* 断开直播连线
|
|
2254
|
+
*
|
|
2255
|
+
* @returns {Promise<void>}
|
|
2256
|
+
*
|
|
2257
|
+
* @example
|
|
2258
|
+
* const roomEngine = new TUIRoomEngine();
|
|
2259
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
2260
|
+
* liveConnectionManager.disconnect();
|
|
2261
|
+
*/
|
|
2262
|
+
disconnect(): Promise<void>;
|
|
2263
|
+
private JSCallNativeFunctionPromise;
|
|
2264
|
+
private observerFunction;
|
|
2265
|
+
private handleLiveConnectionEvent;
|
|
2266
|
+
}
|
|
2267
|
+
|
|
1897
2268
|
/**
|
|
1898
2269
|
* TUIRoomEngine 提供了音视频房间的能力
|
|
1899
2270
|
*
|
|
@@ -1908,6 +2279,8 @@ declare class TUIRoomEngine {
|
|
|
1908
2279
|
private conferenceListManager;
|
|
1909
2280
|
private conferenceInvitationManager;
|
|
1910
2281
|
private liveListManager;
|
|
2282
|
+
private liveLayoutManager;
|
|
2283
|
+
private liveConnectionManager;
|
|
1911
2284
|
private static userId;
|
|
1912
2285
|
private static sdkAppId;
|
|
1913
2286
|
private static Module;
|
|
@@ -1935,6 +2308,13 @@ declare class TUIRoomEngine {
|
|
|
1935
2308
|
*/
|
|
1936
2309
|
private JSCallNativeFunctionPromise;
|
|
1937
2310
|
private JSCallNativeRequestFunctionPromise;
|
|
2311
|
+
/**
|
|
2312
|
+
* @private
|
|
2313
|
+
* 调用 TUIRoomEngineWASM 的 CallAPI 方法
|
|
2314
|
+
* @param funcName
|
|
2315
|
+
* @param jsonString
|
|
2316
|
+
*/
|
|
2317
|
+
private JSCallNativeCallAPIPromise;
|
|
1938
2318
|
/**
|
|
1939
2319
|
* 登录 TUIRoomEngine
|
|
1940
2320
|
*
|
|
@@ -2020,7 +2400,7 @@ declare class TUIRoomEngine {
|
|
|
2020
2400
|
* @param {string=} [options.roomName=roomId] 房间名称,默认值为 roomId,传入的值不能为空字符串
|
|
2021
2401
|
* @param {TUIRoomType=} [options.roomType=TUIRoomType.kConference] 房间类型, 默认值为 TUIRoomType.kConference <br>
|
|
2022
2402
|
* 办公协同、医疗问诊、远程会议、教育场景,roomType 设置为 TUIRoomType.kConference
|
|
2023
|
-
* 电商直播、语聊房场景,roomType 设置为 TUIRoomType.
|
|
2403
|
+
* 电商直播、语聊房场景,roomType 设置为 TUIRoomType.kLive
|
|
2024
2404
|
* @param {boolean=} [options.isSeatEnabled=false] 是否开启麦位控制,默认值为 false
|
|
2025
2405
|
* @param {TUISeatMode=} [options.seatMode=TUISeatMode.kFreeToTake] 上麦模式(开启麦位控制后生效),默认值为 TUISeatMode.kFreeToTake <br>
|
|
2026
2406
|
* 自由上麦模式,台下观众可以自由上麦,无需申请,seatMode 设置为 TUISeatMode.kFreeToTake
|
|
@@ -2031,8 +2411,9 @@ declare class TUIRoomEngine {
|
|
|
2031
2411
|
* @param {boolean=} [options.isMessageDisableForAllUser=false] 是否允许成员发送消息,默认不禁止(创建房间可选参数)
|
|
2032
2412
|
* @param {number=} options.maxSeatCount 最大麦位数量 (创建房间可选参数)
|
|
2033
2413
|
* @param {string=} [options.password=''] 房间密码,(该属性自 v2.5.0 版本支持) <br>
|
|
2414
|
+
* @param {boolean=} [options.keepOwnerOnSeat=false] 是否保持房主座位,默认不保持房主座位(该属性自 v3.1.0 版本支持)
|
|
2034
2415
|
* roomType 为 TUIRoomType.kConference (教育及会议场景) 时,maxSeatCount 值不做限制;
|
|
2035
|
-
* roomType 为 TUIRoomType.kLive(直播场景) 时,maxSeatCount 最大限制为 16;
|
|
2416
|
+
* roomType 为 TUIRoomType.kLive (直播场景) 时,maxSeatCount 最大限制为 16;
|
|
2036
2417
|
* @returns {Promise<void>}
|
|
2037
2418
|
*
|
|
2038
2419
|
* @example
|
|
@@ -2057,6 +2438,7 @@ declare class TUIRoomEngine {
|
|
|
2057
2438
|
isMessageDisableForAllUser?: boolean;
|
|
2058
2439
|
maxSeatCount?: number;
|
|
2059
2440
|
password?: string;
|
|
2441
|
+
keepOwnerOnSeat?: boolean;
|
|
2060
2442
|
}): Promise<void>;
|
|
2061
2443
|
/**
|
|
2062
2444
|
* 进入房间接口
|
|
@@ -2940,36 +3322,42 @@ declare class TUIRoomEngine {
|
|
|
2940
3322
|
*/
|
|
2941
3323
|
getSeatApplicationList(): Promise<TUIRequest[]>;
|
|
2942
3324
|
/**
|
|
3325
|
+
* @since v3.1.0
|
|
2943
3326
|
* 发送文本消息
|
|
2944
|
-
* @deprecated 该接口自 v2.0.0 版本废弃,请使用 {@link getTIM} 方法获取 tim 实例发送消息
|
|
2945
3327
|
* @param {object} options
|
|
2946
|
-
* @param {string} options.
|
|
3328
|
+
* @param {string} options.textContent 文本消息内容
|
|
3329
|
+
* @param {object} options.extensionInfo 扩展信息
|
|
2947
3330
|
* @returns {Promise<void>}
|
|
2948
3331
|
*
|
|
2949
3332
|
* @example
|
|
2950
3333
|
* const roomEngine = new TUIRoomEngine();
|
|
2951
3334
|
* await roomEngine.sendTextMessage({
|
|
2952
|
-
*
|
|
3335
|
+
* textContent: 'hello, everyone',
|
|
3336
|
+
* extensionInfo: {}
|
|
2953
3337
|
* });
|
|
2954
3338
|
*/
|
|
2955
3339
|
sendTextMessage(options: {
|
|
2956
|
-
|
|
3340
|
+
textContent: string;
|
|
3341
|
+
extensionInfo: object;
|
|
2957
3342
|
}): Promise<void>;
|
|
2958
3343
|
/**
|
|
3344
|
+
* @since v3.1.0
|
|
2959
3345
|
* 发送自定义消息
|
|
2960
3346
|
* @param {object} options
|
|
2961
|
-
* @
|
|
2962
|
-
* @param {string} options.
|
|
3347
|
+
* @param {string} options.businessId 业务 Id
|
|
3348
|
+
* @param {string} options.data 自定义消息内容
|
|
2963
3349
|
* @returns {Promise<void>}
|
|
2964
3350
|
*
|
|
2965
3351
|
* @example
|
|
2966
3352
|
* const roomEngine = new TUIRoomEngine();
|
|
2967
3353
|
* await roomEngine.sendCustomMessage({
|
|
2968
|
-
*
|
|
3354
|
+
* businessId: '111',
|
|
3355
|
+
* data: '{"msg":"test"}',
|
|
2969
3356
|
* });
|
|
2970
3357
|
*/
|
|
2971
3358
|
sendCustomMessage(options: {
|
|
2972
|
-
|
|
3359
|
+
businessId: string;
|
|
3360
|
+
data: string;
|
|
2973
3361
|
}): Promise<void>;
|
|
2974
3362
|
/**
|
|
2975
3363
|
* 开始屏幕共享
|
|
@@ -3196,12 +3584,19 @@ declare class TUIRoomEngine {
|
|
|
3196
3584
|
* 开始进行麦克风测试
|
|
3197
3585
|
* @param options
|
|
3198
3586
|
* @param {number} options.interval 麦克风音量的回调时间
|
|
3587
|
+
*
|
|
3588
|
+
* @example
|
|
3589
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3590
|
+
* await roomEngine.startMicDeviceTest({interval: 200});
|
|
3199
3591
|
*/
|
|
3200
3592
|
startMicDeviceTest(options: {
|
|
3201
3593
|
interval: number;
|
|
3202
3594
|
}): Promise<void>;
|
|
3203
3595
|
/**
|
|
3204
3596
|
* 停止进行麦克风测试
|
|
3597
|
+
* @example
|
|
3598
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3599
|
+
* await roomEngine.stopMicDeviceTest();
|
|
3205
3600
|
*/
|
|
3206
3601
|
stopMicDeviceTest(): Promise<void>;
|
|
3207
3602
|
/**
|
|
@@ -3236,6 +3631,28 @@ declare class TUIRoomEngine {
|
|
|
3236
3631
|
* const liveListManager = roomEngine.getLiveListManager();
|
|
3237
3632
|
*/
|
|
3238
3633
|
getLiveListManager(): TUILiveListManager;
|
|
3634
|
+
/**
|
|
3635
|
+
* v3.0.0 版本起支持 getLiveLayoutManager 获取 TUILiveLayoutManager 模块
|
|
3636
|
+
*
|
|
3637
|
+
* @since v3.0.0
|
|
3638
|
+
* @returns {TUILiveLayoutManager}
|
|
3639
|
+
*
|
|
3640
|
+
* @example
|
|
3641
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3642
|
+
* const liveLayoutManager = roomEngine.getLiveLayoutManager();
|
|
3643
|
+
*/
|
|
3644
|
+
getLiveLayoutManager(): TUILiveLayoutManager;
|
|
3645
|
+
/**
|
|
3646
|
+
* v3.2.0 版本起支持 getLiveConnectionManager 获取 TUILiveConnectionManager 模块
|
|
3647
|
+
*
|
|
3648
|
+
* @since v3.2.0
|
|
3649
|
+
* @returns {TUILiveConnectionManager}
|
|
3650
|
+
*
|
|
3651
|
+
* @example
|
|
3652
|
+
* const roomEngine = new TUIRoomEngine();
|
|
3653
|
+
* const liveConnectionManager = roomEngine.getLiveConnectionManager();
|
|
3654
|
+
*/
|
|
3655
|
+
getLiveConnectionManager(): TUILiveConnectionManager;
|
|
3239
3656
|
/**
|
|
3240
3657
|
* v2.6.0 版本起支持使用 getConferenceInvitationManager 获取 conferenceInvitation 模块
|
|
3241
3658
|
* @since v2.6.0
|
|
@@ -3278,4 +3695,4 @@ declare class TUIRoomEngine {
|
|
|
3278
3695
|
private static handleSetFramework;
|
|
3279
3696
|
}
|
|
3280
3697
|
|
|
3281
|
-
export { TRTCRole, TUIAudioQuality, TUIAudioRoute, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, type TUIConferenceInfo, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, type TUIConferenceModifyInfo, TUIConferenceStatus, type TUIDeviceInfo, type TUIEnterRoomOptions, TUIErrorCode, type TUIInvitation, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, type TUILiveInfo, TUILiveLayoutManagerEvents, TUILiveListManagerEvents, type TUILiveListResult, TUILiveModifyFlag, type TUILiveModifyInfo, 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 TUISeatLockParams, TUISeatMode, type TUIUserInfo, type TUIVideoEncoderParams, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
|
|
3698
|
+
export { TRTCRole, TUIAudioQuality, TUIAudioRoute, TUICaptureSourceType, TUIChangeReason, TUIConferenceCancelReason, type TUIConferenceInfo, TUIConferenceInvitationManager, TUIConferenceInvitationManagerEvents, TUIConferenceListManager, TUIConferenceListManagerEvents, type TUIConferenceModifyInfo, TUIConferenceStatus, type TUIDeviceInfo, type TUIEnterRoomOptions, TUIErrorCode, type TUIInvitation, TUIInvitationCode, TUIInvitationRejectedReason, TUIInvitationStatus, TUIKickedOutOfRoomReason, TUILiveConnectionManagerEvents, type TUILiveInfo, TUILiveLayoutManager, TUILiveLayoutManagerEvents, TUILiveListManager, TUILiveListManagerEvents, type TUILiveListResult, TUILiveModifyFlag, type TUILiveModifyInfo, 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 TUISeatLockParams, TUISeatMode, type TUIUserInfo, type TUIVideoEncoderParams, TUIVideoQuality, TUIVideoStreamType, TUIRoomEngine as default };
|