@tencentcloud/tuiroom-engine-electron 2.9.1 → 3.0.6-beta.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.d.ts CHANGED
@@ -23,33 +23,28 @@ declare enum TUIErrorCode {
23
23
  ERR_MICROPHONE_DEVICE_EMPTY = -1107,
24
24
  ERR_GET_SCREEN_SHARING_TARGET_FAILED = -1108,
25
25
  ERR_START_SCREEN_SHARING_FAILED = -1109,
26
- ERR_ROOM_ID_NOT_EXIST = -2100,
26
+ ERR_ALREADY_ROOM_OWNER = -1200,
27
+ ERR_IM_ATTRIBUTE_WRITE_CONFLICT = -1201,
28
+ ERR_ALREADY_ROOM_ENTER = -1202,
29
+ ERR_DESTROY_ROOM_NO_PERMISSION = -1203,
30
+ ERR_LIVE_REQUEST_SERVER_TIMEOUT = -1300,
31
+ ERR_LIVE_SERVER_PROCESS_FAILED = -1301,
32
+ ERR_LIVE_DISCONNECTED = -1302,
33
+ ERR_LIVE_NO_AVAILABLE_HEVC_DECODERS = -1303,
27
34
  ERR_OPERATION_INVALID_BEFORE_ENTER_ROOM = -2101,
28
35
  ERR_EXIT_NOT_SUPPORTED_FOR_ROOM_OWNER = -2102,
29
36
  ERR_OPERATION_NOT_SUPPORTED_IN_CURRENT_ROOM_TYPE = -2103,
30
37
  ERR_ROOM_ID_INVALID = -2105,
31
- ERR_ROOM_ID_OCCUPIED = -2106,
32
38
  ERR_ROOM_NAME_INVALID = -2107,
33
39
  ERR_ALREADY_IN_OTHER_ROOM = -2108,
34
- ERR_NEED_PASSWORD = -2109,
35
- ERR_WRONG_PASSWORD = -2110,
36
- ERR_ROOM_USER_FULL = -2111,
37
40
  ERR_USER_NOT_EXIST = -2200,
38
- ERR_USER_NOT_ENTERED = -2201,
39
41
  ERR_NEED_OWNER_PERMISSION = -2300,
40
42
  ERR_NEED_ADMIN_PERMISSION = -2301,
41
43
  ERR_REQUEST_NO_PERMISSION = -2310,
42
44
  ERR_REQUEST_ID_INVALID = -2311,
43
45
  ERR_REQUEST_ID_REPEAT = -2312,
44
- ERR_REQUEST_ID_CONFLICT = -2313,
45
46
  ERR_MAX_SEAT_COUNT_LIMIT = -2340,
46
- ERR_ALREADY_IN_SEAT = -2341,
47
- ERR_SEAT_OCCUPIED = -2342,
48
- ERR_SEAT_LOCKED = -2343,
49
47
  ERR_SEAT_INDEX_NOT_EXIST = -2344,
50
- ERR_USER_NOT_IN_SEAT = -2345,
51
- ERR_ALL_SEAT_OCCUPIED = -2346,
52
- ERR_SEAT_NOT_SUPPORT_LINK_MIC = -2347,
53
48
  ERR_OPEN_MICROPHONE_NEED_SEAT_UNLOCK = -2360,
54
49
  ERR_OPEN_MICROPHONE_NEED_PERMISSION_FROM_ADMIN = -2361,
55
50
  ERR_OPEN_CAMERA_NEED_SEAT_UNLOCK = -2370,
@@ -57,7 +52,28 @@ declare enum TUIErrorCode {
57
52
  ERR_OPEN_SCREEN_SHARE_NEED_SEAT_UNLOCK = -2372,
58
53
  ERR_OPEN_SCREEN_SHARE_NEED_PERMISSION_FROM_ADMIN = -2373,
59
54
  ERR_SEND_MESSAGE_DISABLED_FOR_ALL = -2380,
60
- ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT = -2381
55
+ ERR_SEND_MESSAGE_DISABLED_FOR_CURRENT = -2381,
56
+ ERR_ROOM_ID_OCCUPIED = 100003,
57
+ ERR_ROOM_ID_NOT_EXIST = 100004,
58
+ ERR_USER_NOT_ENTERED = 100005,
59
+ ERR_NEED_PASSWORD = 100018,
60
+ ERR_WRONG_PASSWORD = 100019,
61
+ ERR_ROOM_USER_FULL = 100008,
62
+ ERR_REQUEST_CONFLICT = 100102,
63
+ ERR_SEAT_OCCUPIED = 100210,
64
+ ERR_ALREADY_IN_SEAT = 100203,
65
+ ERR_SEAT_LOCKED = 100200,
66
+ ERR_ALL_SEAT_OCCUPIED = 100205,
67
+ ERR_USER_NOT_IN_SEAT = 100206,
68
+ ERR_SEAT_NOT_SUPPORT_LINK_MIC = 100211,
69
+ ERR_ROOM_ALREADY_CONNECTED = 100401,
70
+ ERR_ROOM_CONNECTED_IN_OTHER = 100403,
71
+ ERR_MAX_CONNECTED_COUNT_LIMIT = 100404,
72
+ ERR_BATTLE_IN_RUNNING = 100419,
73
+ ERR_BATTLE_ID_NOT_EXIST = 100411,
74
+ ERR_ROOM_BATTLEID_IN_OTHER = 100415,
75
+ ERR_ROOM_METADATA_EXCEED_KEY_COUNT_LIMIT = 100500,
76
+ ERR_ROOM_METADATA_EXCEED_VALUE_SIZE_LIMIT = 100501
61
77
  }
62
78
  type TUIRoomInfo = {
63
79
  roomId: string;
@@ -446,6 +462,7 @@ declare enum TUIRoomEvents {
446
462
  * @default 'onRoomUserCountChanged'
447
463
  * @event TUIRoomEvents#onRoomUserCountChanged
448
464
  * @param {object} options
465
+ * @param {string} options.roomId 房间号
449
466
  * @param {number} options.userCount 房间内人数
450
467
  * @example
451
468
  * const roomEngine = new TUIRoomEngine();
@@ -1010,13 +1027,15 @@ declare enum TUIConferenceInvitationManagerEvents {
1010
1027
  * @param {object} options
1011
1028
  * @param {TUIRoomInfo} options.roomInfo 会议信息。
1012
1029
  * @param {TUIInvitation} options.invitation 邀请信息。
1030
+ * @param {TUIInvitationRejectedReason} options.reason 拒绝加入会议的原因。
1031
+ *
1013
1032
  *
1014
1033
  *
1015
1034
  * @example
1016
1035
  * const roomEngine = new TUIRoomEngine();
1017
1036
  * const conferenceInvitationManager = roomEngine.getConferenceInvitationManager();
1018
- * conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationRejected, ({ roomInfo, invitation }) => {
1019
- * console.log('conferenceInvitationManager.onInvitationRejected', roomInfo, invitation);
1037
+ * conferenceInvitationManager.on(TUIConferenceInvitationManagerEvents.onInvitationRejected, ({ roomInfo, invitation, reason }) => {
1038
+ * console.log('conferenceInvitationManager.onInvitationRejected', roomInfo, invitation, reason);
1020
1039
  * })
1021
1040
  */
1022
1041
  onInvitationRejected = "onInvitationRejected",
@@ -1106,6 +1125,72 @@ declare enum TUIConferenceInvitationManagerEvents {
1106
1125
  * })
1107
1126
  */
1108
1127
  onInvitationStatusChanged = "onInvitationStatusChanged"
1128
+ }
1129
+ type TUILiveInfo = {
1130
+ basicRoomInfo: TUIRoomInfo;
1131
+ isGiftEnabled: boolean;
1132
+ isLikeEnabled: boolean;
1133
+ isPublicVisible: boolean;
1134
+ activityStatus: number;
1135
+ viewCount: number;
1136
+ coverUrl: string;
1137
+ backgroundUrl: string;
1138
+ categoryList: Array<number>;
1139
+ };
1140
+ type TUILiveModifyInfo = {
1141
+ roomId: string;
1142
+ isPublicVisible?: boolean;
1143
+ activityStatus?: number;
1144
+ coverUrl?: string;
1145
+ backgroundUrl?: string;
1146
+ categoryList?: Array<number>;
1147
+ };
1148
+ declare enum TUILiveModifyFlag {
1149
+ kNone = 0,
1150
+ kActivityStatus = 256,
1151
+ kCoverUrl = 512,
1152
+ kCategory = 1024,
1153
+ kEnableGift = 2048,
1154
+ kEnableLike = 4096,
1155
+ kPublic = 8192,
1156
+ kBackgroundUrl = 262144
1157
+ }
1158
+ type TUILiveListResult = {
1159
+ cursor: string;
1160
+ listInfoList: Array<TUILiveInfo>;
1161
+ };
1162
+ /**
1163
+ * @since v2.9.0
1164
+ * ** TUILiveListManager 事件列表**<br>
1165
+ */
1166
+ declare enum TUILiveListManagerEvents {
1167
+ /**
1168
+ * @description 直播间信息发生变化事件回调
1169
+ * @default 'onLiveInfoChanged'
1170
+ * @event TUILiveListManagerEvents#onLiveInfoChanged
1171
+ * @param {object} options
1172
+ * @param {TUILiveInfo} options.liveInfo 直播间信息
1173
+ * @param {TUILiveModifyFlag} options.modifyFlag 直播间修改标识
1174
+ *
1175
+ * @example
1176
+ * const roomEngine = new TUIRoomEngine();
1177
+ * const liveListManager = roomEngine.getLiveListManager();
1178
+ * liveListManager.on(TUILiveListManagerEvents.onLiveInfoChanged, ({ liveInfo, modifyFlag}) => {
1179
+ * console.log('liveListManager.onLiveInfoChanged', liveInfo, modifyFlag);
1180
+ * });
1181
+ */
1182
+ onLiveInfoChanged = "onLiveInfoChanged"
1183
+ }
1184
+ declare enum TUILiveLayoutManagerEvents {
1185
+ /**
1186
+ * const roomEngine = new TUIRoomEngine();
1187
+ * const liveLayoutManager = roomEngine.getLiveLayoutManager();
1188
+ * const callback = (roomId, layoutInfo) => {
1189
+ * console.log('liveLayoutManager.onLiveVideoLayoutChanged', roomId, layoutInfo);
1190
+ * };
1191
+ * liveLayoutManager.on(TUILiveLayoutManagerEvents.onLiveVideoLayoutChanged, callback);
1192
+ */
1193
+ onLiveVideoLayoutChanged = "onLiveVideoLayoutChanged"
1109
1194
  }
1110
1195
 
1111
1196
  declare class Logger {
@@ -1691,6 +1776,124 @@ declare class TUIConferenceInvitationManager {
1691
1776
  off(event: string, func: (...args: any[]) => void): void;
1692
1777
  }
1693
1778
 
1779
+ /**
1780
+ * 直播列表
1781
+ * @class TUILiveListManager
1782
+ */
1783
+ declare class TUILiveListManager {
1784
+ private liveListManagerWASM;
1785
+ private logger;
1786
+ private static liveListManager;
1787
+ constructor(options: {
1788
+ Module: any;
1789
+ logger: Logger;
1790
+ roomEngineWASM: any;
1791
+ });
1792
+ /**
1793
+ * 修改直播间信息
1794
+ *
1795
+ * @param {object} options
1796
+ * @param {string} options.roomId 直播房间 ID
1797
+ * @param {number} options.activityStatus 可选,直播间活跃状态: 用户自定义标记
1798
+ * @param {Array<number>} options.categoryList 可选,直播间分类标签,单个房间最大支持3个标记
1799
+ * @param {string} options.coverUrl 可选,直播间封面图片 HTTP URL 地址,最大支持 200 个字节
1800
+ * @param {string} options.backgroundUrl 可选,直播间背景图片 HTTP URL 地址,最大支持 200 个字节
1801
+ * @param {boolean} options.isPublicVisible 可选,直播间是否公开
1802
+ * @returns {Promise<void>}
1803
+ *
1804
+ * @example
1805
+ * const roomEngine = new TUIRoomEngine();
1806
+ * const liveListManager = roomEngine.getLiveListManager();
1807
+ * liveListManager.setLiveInfo({
1808
+ * roomId: "141569",
1809
+ * coverUrl: "https://qcloudimg.tencent-cloud.cn/image/document/live-cover.png",
1810
+ * isPublicVisible: false,
1811
+ * activityStatus: 1,
1812
+ * categoryList: [1,2,3],
1813
+ * backgroundUrl: "https://qcloudimg.tencent-cloud.cn/image/document/live-cover.png"
1814
+ * });
1815
+ */
1816
+ setLiveInfo(options: {
1817
+ roomId: string;
1818
+ activityStatus?: number;
1819
+ categoryList?: Array<number>;
1820
+ coverUrl?: string;
1821
+ isPublicVisible?: boolean;
1822
+ backgroundUrl?: string;
1823
+ }): Promise<void>;
1824
+ /**
1825
+ * 获取直播间信息
1826
+ *
1827
+ * @param {object} options
1828
+ * @param {string} options.roomId 直播房间 ID
1829
+ * @returns {Promise<TUILiveInfo>}
1830
+ *
1831
+ * @example
1832
+ * const roomEngine = new TUIRoomEngine();
1833
+ * const liveListManager = roomEngine.getLiveListManager();
1834
+ * const result = await liveListManager.getLiveInfo({ roomId: "141569" });
1835
+ */
1836
+ getLiveInfo(options: {
1837
+ roomId: string;
1838
+ }): Promise<TUILiveInfo>;
1839
+ /**
1840
+ * 获取直播间列表
1841
+ *
1842
+ * @param {object} options
1843
+ * @param {string} options.cursor 分页获取索引,第一次拉取填 '',返回的数据中 cursor 不为 '',表示需要分页,请以返回的 cursor 作为参数再次调用接口拉取,直至返回的cursor为 '',表示数据已经全部拉取。
1844
+ * @param {number} options.count 本次拉取数量
1845
+ * @returns {Promise<TUILiveListResult>}
1846
+ *
1847
+ * @example
1848
+ * const roomEngine = new TUIRoomEngine();
1849
+ * const liveListManager = roomEngine.getLiveListManager();
1850
+ * const liveList = [];
1851
+ * let cursor = '';
1852
+ * let count = 20;
1853
+ * let result;
1854
+ * do {
1855
+ * result = await liveListManager.fetchLiveList({ cursor, count });
1856
+ * liveList.push(...result.liveInfoList);
1857
+ * cursor = result.cursor;
1858
+ * } while(cursor !== '');
1859
+ */
1860
+ fetchLiveList(options: {
1861
+ cursor: string;
1862
+ count: number;
1863
+ }): Promise<TUILiveListResult>;
1864
+ private JSCallNativeFunctionPromise;
1865
+ /**
1866
+ * 监听 TUILiveListManager 事件
1867
+ * @param {TUILiveListManagerEvents} event - 事件名
1868
+ * @param {Function} func - 事件回调函数
1869
+ *
1870
+ * @example
1871
+ * const roomEngine = new TUIRoomEngine();
1872
+ * const liveListManager = roomEngine.getLiveListManager();
1873
+ * const callback = ({ liveModifyInfo }) => {
1874
+ * console.log('liveListManager.onLiveInfoChanged', liveModifyInfo);
1875
+ * };
1876
+ * liveListManager.on(TUILiveListManagerEvents.onLiveInfoChanged, callback);
1877
+ */
1878
+ on(event: TUILiveListManagerEvents, func: (...args: any[]) => void): void;
1879
+ /**
1880
+ * 取消 TUILiveListManager 事件监听
1881
+ * @param {TUILiveListManagerEvents} event - 事件名
1882
+ * @param {Function} func - 事件回调函数
1883
+ *
1884
+ * @example
1885
+ * const roomEngine = new TUIRoomEngine();
1886
+ * const liveListManager = roomEngine.getLiveListManager();
1887
+ * const callback = ({ liveModifyInfo }) => {
1888
+ * console.log('liveListManager.onLiveInfoChanged', liveModifyInfo);
1889
+ * };
1890
+ * liveListManager.off(TUILiveListManagerEvents.onLiveInfoChanged, callback);
1891
+ */
1892
+ off(event: TUILiveListManagerEvents, func: (...args: any[]) => void): void;
1893
+ private observerFunction;
1894
+ private handleLiveInfoChangeEvent;
1895
+ }
1896
+
1694
1897
  /**
1695
1898
  * TUIRoomEngine 提供了音视频房间的能力
1696
1899
  *
@@ -1704,6 +1907,7 @@ declare class TUIRoomEngine {
1704
1907
  private deviceManager;
1705
1908
  private conferenceListManager;
1706
1909
  private conferenceInvitationManager;
1910
+ private liveListManager;
1707
1911
  private static userId;
1708
1912
  private static sdkAppId;
1709
1913
  private static Module;
@@ -3021,6 +3225,17 @@ declare class TUIRoomEngine {
3021
3225
  * @returns {TUIConferenceListManager} conferenceListManager
3022
3226
  */
3023
3227
  getConferenceListManager(): TUIConferenceListManager;
3228
+ /**
3229
+ * v3.0.0 版本器支持 getLiveListManager 获取 TUILiveListManager 模块
3230
+ *
3231
+ * @since v3.0.0
3232
+ * @returns {TUILiveListManager}
3233
+ *
3234
+ * @example
3235
+ * const roomEngine = new TUIRoomEngine();
3236
+ * const liveListManager = roomEngine.getLiveListManager();
3237
+ */
3238
+ getLiveListManager(): TUILiveListManager;
3024
3239
  /**
3025
3240
  * v2.6.0 版本起支持使用 getConferenceInvitationManager 获取 conferenceInvitation 模块
3026
3241
  * @since v2.6.0
@@ -3063,4 +3278,4 @@ declare class TUIRoomEngine {
3063
3278
  private static handleSetFramework;
3064
3279
  }
3065
3280
 
3066
- 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 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 };
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 };