@byteplus/rtc 4.40.0 → 4.41.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 +443 -21
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -18,11 +18,14 @@ declare enum ErrorCode {
|
|
|
18
18
|
* @brief Token is invalid or has expired.
|
|
19
19
|
*/
|
|
20
20
|
INVALID_TOKEN = "INVALID_TOKEN",
|
|
21
|
+
EXPIRED_TOKEN = "EXPIRED_TOKEN",
|
|
21
22
|
|
|
22
23
|
/**
|
|
23
24
|
* @brief Failure of joining room
|
|
24
25
|
*/
|
|
25
26
|
JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
|
|
27
|
+
UPDATE_TOKEN_WITH_INVALID_TOKEN = "UPDATE_TOKEN_WITH_INVALID_TOKEN",
|
|
28
|
+
UPDATE_TOKEN_BEFORE_JOIN = "UPDATE_TOKEN_BEFORE_JOIN",
|
|
26
29
|
|
|
27
30
|
/**
|
|
28
31
|
* @brief Join the same room repeatedly.
|
|
@@ -34,6 +37,16 @@ declare enum ErrorCode {
|
|
|
34
37
|
*/
|
|
35
38
|
REPEAT_PUBLISH = "REPEAT_PUBLISH",
|
|
36
39
|
|
|
40
|
+
/**
|
|
41
|
+
* @brief Publish public stream repeatedly.
|
|
42
|
+
*/
|
|
43
|
+
REPEAT_PUSH = "REPEAT_PUSH",
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @brief Subscribe to the public stream repeatedly.
|
|
47
|
+
*/
|
|
48
|
+
REPEAT_PLAY = "REPEAT_PLAY",
|
|
49
|
+
|
|
37
50
|
/**
|
|
38
51
|
* @brief Publish before joining a room.
|
|
39
52
|
*/
|
|
@@ -90,13 +103,11 @@ declare enum ErrorCode {
|
|
|
90
103
|
ALREADY_IN_ROOM = "ALREADY_IN_ROOM",
|
|
91
104
|
|
|
92
105
|
/**
|
|
93
|
-
* @hidden
|
|
94
106
|
* @brief The user has been remove from the room by the administrator via a OpenAPI call.
|
|
95
107
|
*/
|
|
96
108
|
KICKED_OUT = "KICKED_OUT",
|
|
97
109
|
|
|
98
110
|
/**
|
|
99
|
-
* @hidden
|
|
100
111
|
* @brief Users have been removed from the room because the administrator dismissed the room by calling OpenAPI.
|
|
101
112
|
*/
|
|
102
113
|
ROOM_DISMISS = "ROOM_DISMISS",
|
|
@@ -223,6 +234,14 @@ declare enum ErrorCode {
|
|
|
223
234
|
*/
|
|
224
235
|
OPERATION_CANCEL = "OPERATION_CANCEL",
|
|
225
236
|
|
|
237
|
+
/**
|
|
238
|
+
*/
|
|
239
|
+
START_CLOUD_PROXY_AFTER_JOIN = "START_CLOUD_PROXY_AFTER_JOIN",
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
*/
|
|
243
|
+
STOP_CLOUD_PROXY_BEFORE_LEAVE = "STOP_CLOUD_PROXY_BEFORE_LEAVE",
|
|
244
|
+
|
|
226
245
|
/**
|
|
227
246
|
* @brief Unknown error
|
|
228
247
|
*/
|
|
@@ -321,7 +340,12 @@ declare enum ErrorCode {
|
|
|
321
340
|
/**
|
|
322
341
|
* @brief Unknown error of messaging
|
|
323
342
|
*/
|
|
324
|
-
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN"
|
|
343
|
+
USER_MESSAGE_UNKNOWN = "USER_MESSAGE_UNKNOWN",
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* @brief The user publishes a public stream before joining room.
|
|
347
|
+
*/
|
|
348
|
+
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN"
|
|
325
349
|
}
|
|
326
350
|
declare enum AudioMixingError {
|
|
327
351
|
|
|
@@ -760,6 +784,17 @@ export interface onVideoFirstFrameDecodedEvent {
|
|
|
760
784
|
width: number;
|
|
761
785
|
}
|
|
762
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Event related to decoding the first video frame of the public stream.
|
|
789
|
+
*/
|
|
790
|
+
export declare type PublicStreamVideoFirstFrameDecodedEvent = Omit<onVideoFirstFrameDecodedEvent, "userId"> & {
|
|
791
|
+
|
|
792
|
+
/**
|
|
793
|
+
* @brief The public stream's ID.
|
|
794
|
+
*/
|
|
795
|
+
publicStreamId: string;
|
|
796
|
+
};
|
|
797
|
+
|
|
763
798
|
/**
|
|
764
799
|
* Event related to the decoder of the first audio frame
|
|
765
800
|
*/
|
|
@@ -771,6 +806,17 @@ export interface onAudioFirstFrameDecodedEvent {
|
|
|
771
806
|
userId: string;
|
|
772
807
|
}
|
|
773
808
|
|
|
809
|
+
/**
|
|
810
|
+
* @brief Event related to decoding or rendering the first video frame of the public stream.
|
|
811
|
+
*/
|
|
812
|
+
export interface PublicStreamAudioFirstFrameDecodedEvent {
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* @brief The public stream's ID.
|
|
816
|
+
*/
|
|
817
|
+
publicStreamId: string;
|
|
818
|
+
}
|
|
819
|
+
|
|
774
820
|
/**
|
|
775
821
|
* State of the media devices which including audio capture device. audio playback device, and video capture device.
|
|
776
822
|
*/
|
|
@@ -808,6 +854,23 @@ export interface onSEIMessageEvent {
|
|
|
808
854
|
sei: Uint8Array;
|
|
809
855
|
}
|
|
810
856
|
|
|
857
|
+
/**
|
|
858
|
+
* @hidden
|
|
859
|
+
* @brief The SEI carried by the public video stream.
|
|
860
|
+
*/
|
|
861
|
+
export interface PublicStreamSEIMessageEvent {
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* @brief The public stream's ID.
|
|
865
|
+
*/
|
|
866
|
+
publicStreamId: string;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* @brief SEI message.
|
|
870
|
+
*/
|
|
871
|
+
sei: Uint8Array;
|
|
872
|
+
}
|
|
873
|
+
|
|
811
874
|
/**
|
|
812
875
|
* State of the local audio stream
|
|
813
876
|
*/
|
|
@@ -1171,6 +1234,22 @@ export interface RemoteStreamStats {
|
|
|
1171
1234
|
*/
|
|
1172
1235
|
rxQuality?: number;
|
|
1173
1236
|
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* @brief Subscribed public stream's statistics and network condition, reference period 2s.
|
|
1240
|
+
*/
|
|
1241
|
+
export declare type PublicStreamStats = Omit<
|
|
1242
|
+
|
|
1243
|
+
/**
|
|
1244
|
+
* @brief Remote stream stats
|
|
1245
|
+
*/
|
|
1246
|
+
RemoteStreamStats, "userId" | "isScreen"> & {
|
|
1247
|
+
|
|
1248
|
+
/**
|
|
1249
|
+
* @brief The public stream's ID.
|
|
1250
|
+
*/
|
|
1251
|
+
publicStreamId: string;
|
|
1252
|
+
};
|
|
1174
1253
|
declare enum EngineEventsTypes {
|
|
1175
1254
|
|
|
1176
1255
|
/**
|
|
@@ -1258,6 +1337,21 @@ declare enum EngineEventsTypes {
|
|
|
1258
1337
|
*/
|
|
1259
1338
|
onAudioFirstFrameDecoded = "onAudioFirstFrameDecoded",
|
|
1260
1339
|
|
|
1340
|
+
/**
|
|
1341
|
+
* The first video frame has been rendered successfully.
|
|
1342
|
+
*/
|
|
1343
|
+
onFirstPublicStreamVideoFrameRendered = "onFirstPublicStreamVideoFrameRendered",
|
|
1344
|
+
|
|
1345
|
+
/**
|
|
1346
|
+
* The first video frame has been decoded successfully.
|
|
1347
|
+
*/
|
|
1348
|
+
onFirstPublicStreamVideoFrameDecoded = "onFirstPublicStreamVideoFrameDecoded",
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* The first audio frame has been decoded successfully.
|
|
1352
|
+
*/
|
|
1353
|
+
onFirstPublicStreamAudioFrameDecoded = "onFirstPublicStreamAudioFrameDecoded",
|
|
1354
|
+
|
|
1261
1355
|
/**
|
|
1262
1356
|
* @brief The state of the media device changes.
|
|
1263
1357
|
*/
|
|
@@ -1268,6 +1362,11 @@ declare enum EngineEventsTypes {
|
|
|
1268
1362
|
*/
|
|
1269
1363
|
onRemoteStreamStats = "onRemoteStreamStats",
|
|
1270
1364
|
|
|
1365
|
+
/**
|
|
1366
|
+
* Callback including the state of the remote public media stream
|
|
1367
|
+
*/
|
|
1368
|
+
onPublicStreamStats = "onPublicStreamStats",
|
|
1369
|
+
|
|
1271
1370
|
/**
|
|
1272
1371
|
* @brief Callback including the state of the local media stream
|
|
1273
1372
|
*/
|
|
@@ -1313,7 +1412,11 @@ declare enum EngineEventsTypes {
|
|
|
1313
1412
|
onError = "onError",
|
|
1314
1413
|
onAudioMixingStateChanged = "onAudioMixingStateChanged",
|
|
1315
1414
|
onUserMessageReceivedOutsideRoom = "onUserMessageReceivedOutsideRoom",
|
|
1316
|
-
onUserBinaryMessageReceivedOutsideRoom = "onUserBinaryMessageReceivedOutsideRoom"
|
|
1415
|
+
onUserBinaryMessageReceivedOutsideRoom = "onUserBinaryMessageReceivedOutsideRoom",
|
|
1416
|
+
onTokenWillExpire = "onTokenWillExpire",
|
|
1417
|
+
onCloudProxyConnected = "onCloudProxyConnected",
|
|
1418
|
+
onPushPublicStreamResult = "onPushPublicStreamResult",
|
|
1419
|
+
onPublicStreamSEIMessageReceived = "onPublicStreamSEIMessageReceived"
|
|
1317
1420
|
}
|
|
1318
1421
|
|
|
1319
1422
|
/**
|
|
@@ -1405,6 +1508,7 @@ export interface PlayerEvent {
|
|
|
1405
1508
|
* @brief userId of the user who is joining the room
|
|
1406
1509
|
*/
|
|
1407
1510
|
userId: string;
|
|
1511
|
+
publicStreamId?: string;
|
|
1408
1512
|
|
|
1409
1513
|
/**
|
|
1410
1514
|
* @brief Readies state of the medias. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/readyState)
|
|
@@ -1603,6 +1707,12 @@ export interface IEngineEvents {
|
|
|
1603
1707
|
*/
|
|
1604
1708
|
[EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
|
|
1605
1709
|
|
|
1710
|
+
/**
|
|
1711
|
+
* @brief Subscribed public stream's statistics and network condition, reference period 2s.
|
|
1712
|
+
* @param stats
|
|
1713
|
+
*/
|
|
1714
|
+
[EngineEventsTypes.onPublicStreamStats]: (stats: PublicStreamStats) => void;
|
|
1715
|
+
|
|
1606
1716
|
/**
|
|
1607
1717
|
* @brief Volume of each of the users in the room
|
|
1608
1718
|
* If the user has not joined a room, the list will only include volume of `local_user`.
|
|
@@ -1704,7 +1814,7 @@ export interface IEngineEvents {
|
|
|
1704
1814
|
* @region Room Management Event
|
|
1705
1815
|
*/
|
|
1706
1816
|
[EngineEventsTypes.onError]: (event: {
|
|
1707
|
-
errorCode: ErrorCode;
|
|
1817
|
+
errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN;
|
|
1708
1818
|
}) => void;
|
|
1709
1819
|
|
|
1710
1820
|
/**
|
|
@@ -1727,6 +1837,72 @@ export interface IEngineEvents {
|
|
|
1727
1837
|
* @region Message Event
|
|
1728
1838
|
*/
|
|
1729
1839
|
[EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
|
|
1840
|
+
[EngineEventsTypes.onTokenWillExpire]: () => void;
|
|
1841
|
+
|
|
1842
|
+
/**
|
|
1843
|
+
* @brief Receives the callback when you call [startCloudProxy](104478#startCloudProxy) to start cloud proxy, and the SDK connects the proxy server successfully.
|
|
1844
|
+
* @param event
|
|
1845
|
+
*/
|
|
1846
|
+
[EngineEventsTypes.onCloudProxyConnected]: (event: CloudProxyConnectedEvent) => void;
|
|
1847
|
+
|
|
1848
|
+
/**
|
|
1849
|
+
* @brief Callback of the result of publishing the public stream.
|
|
1850
|
+
* After calling [startPushPublicStream](#startpushpublicstream), you will be informed of the result through this callback.
|
|
1851
|
+
* @param event
|
|
1852
|
+
*/
|
|
1853
|
+
[EngineEventsTypes.onPushPublicStreamResult]: (event: PublicStreamResultEvent) => void;
|
|
1854
|
+
|
|
1855
|
+
/**
|
|
1856
|
+
* @hidden
|
|
1857
|
+
* @brief Callback of the SEI carried by the public video stream.
|
|
1858
|
+
* You will receive SEI by this callback if the public stream you subscribed to by calling [startPlayPublicStream](#startplaypublicstream) is carrying SEI.
|
|
1859
|
+
* @param event
|
|
1860
|
+
* @notes When multiple streams in the public stream contain SEI:
|
|
1861
|
+
* + You will receive SEI from all the video frames if the SEI do not have conflicts.
|
|
1862
|
+
* + However, if SEI from video frames have conflicts, you will receive only one of them.
|
|
1863
|
+
*/
|
|
1864
|
+
[EngineEventsTypes.onPublicStreamSEIMessageReceived]: (event: PublicStreamSEIMessageEvent) => void;
|
|
1865
|
+
|
|
1866
|
+
/**
|
|
1867
|
+
* @brief Callback of the successful decoding of the first video frame of the public stream.
|
|
1868
|
+
* Refer to [startPlayPublicStream](#startplaypublicstream) for details about subsribing to a public stream.
|
|
1869
|
+
* @param event
|
|
1870
|
+
*/
|
|
1871
|
+
[EngineEventsTypes.onFirstPublicStreamVideoFrameDecoded]: (event: PublicStreamVideoFirstFrameDecodedEvent) => void;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* @brief Callback of the successful decoding of the first audio frame of the public stream.
|
|
1875
|
+
* Refer to [startPlayPublicStream](#startplaypublicstream) for details about subsribing to a public stream.
|
|
1876
|
+
* @param event
|
|
1877
|
+
*/
|
|
1878
|
+
[EngineEventsTypes.onFirstPublicStreamAudioFrameDecoded]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* @brief Callback of the successful rendering of the first video frame of the public stream.
|
|
1882
|
+
* @param event
|
|
1883
|
+
*/
|
|
1884
|
+
[EngineEventsTypes.onFirstPublicStreamVideoFrameRendered]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
/**
|
|
1888
|
+
* @brief Cloud proxy informatio
|
|
1889
|
+
*/
|
|
1890
|
+
export interface CloudProxyInfo {
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* @brief The cloud proxy IP of log report
|
|
1894
|
+
*/
|
|
1895
|
+
logProxy: string;
|
|
1896
|
+
|
|
1897
|
+
/**
|
|
1898
|
+
* @brief The cloud proxy IP of the access
|
|
1899
|
+
*/
|
|
1900
|
+
accessProxy: string;
|
|
1901
|
+
|
|
1902
|
+
/**
|
|
1903
|
+
* @brief The cloud proxy IP of RTC admin control
|
|
1904
|
+
*/
|
|
1905
|
+
configProxy: string;
|
|
1730
1906
|
}
|
|
1731
1907
|
|
|
1732
1908
|
/**
|
|
@@ -1765,7 +1941,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
1765
1941
|
* + You must call this API to end the call, after calling the [joinRoom](#joinroom) method to join the room. Otherwise you cannot start the next call. Repeatedly call this method have no negative impact. <br>
|
|
1766
1942
|
* @region Room Management
|
|
1767
1943
|
*/
|
|
1768
|
-
leaveRoom(): void
|
|
1944
|
+
leaveRoom(waitAck?: boolean): Promise<void>;
|
|
1769
1945
|
|
|
1770
1946
|
/**
|
|
1771
1947
|
* @brief Destroy engine
|
|
@@ -2226,14 +2402,15 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2226
2402
|
* Apps with different AppIDs are not interoperable. <br>
|
|
2227
2403
|
* @param userInfo User information.
|
|
2228
2404
|
* @return
|
|
2229
|
-
* @notes
|
|
2405
|
+
* @notes
|
|
2406
|
+
* + Call logout{@link #logout} to log out the IM server.
|
|
2230
2407
|
* + In the same App ID, the user ID of each user must be unique. The user will be logged out when a user with the same userID joins the room because of the error of `RTM_DUPLICATE_LOGIN`.
|
|
2231
2408
|
* @region Room Management
|
|
2232
2409
|
*/
|
|
2233
2410
|
login(token: string | null, userId: string): Promise<void>;
|
|
2234
2411
|
|
|
2235
2412
|
/**
|
|
2236
|
-
*
|
|
2413
|
+
* After calling this API to logout you are not able to call APIs to send messages and server messages.
|
|
2237
2414
|
* @return
|
|
2238
2415
|
*/
|
|
2239
2416
|
logout(): Promise<void>;
|
|
@@ -2242,7 +2419,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2242
2419
|
* @brief Update the Token used to login. Since all tokens have a limited time-to-live, call this API to refresh the token.
|
|
2243
2420
|
* @param token updated token
|
|
2244
2421
|
* @return
|
|
2245
|
-
* @notes + Call this API to refresh the token after the token has expired with no need for calling
|
|
2422
|
+
* @notes + Call this API to refresh the token after the token has expired with no need for calling login{@link #login}.
|
|
2246
2423
|
* + You will be informed of the expiration of the token if you tried to login with an expired token or during a reconnection. If the token expired after the user has logged in, no actions need to be taken.
|
|
2247
2424
|
*/
|
|
2248
2425
|
updateLoginToken(token: string | null): Promise<void>;
|
|
@@ -2251,7 +2428,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2251
2428
|
* @brief Get the status of a user before sending him/her a P2P message. You can also call this API to check the status of the current user.
|
|
2252
2429
|
* @param userId ID of the user whose status intended to know
|
|
2253
2430
|
* @return
|
|
2254
|
-
* @notes Call
|
|
2431
|
+
* @notes Call login{@link #login} before calling this API.
|
|
2255
2432
|
*/
|
|
2256
2433
|
getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
|
|
2257
2434
|
|
|
@@ -2260,8 +2437,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2260
2437
|
* @param userId ID of the recipient
|
|
2261
2438
|
* @param message Text message within 62 KB.
|
|
2262
2439
|
* @return
|
|
2263
|
-
* @notes + Call
|
|
2264
|
-
* + The recipient must be logged into the server and will receive the text message via [onUserMessageReceivedOutsideRoom]
|
|
2440
|
+
* @notes + Call login{@link #login} before calling this API.
|
|
2441
|
+
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserMessageReceivedOutsideRoom]{@link #[EngineEventsTypes.onUserMessageReceivedOutsideRoom]} if the message has been sent successfully.
|
|
2265
2442
|
*/
|
|
2266
2443
|
sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
|
|
2267
2444
|
|
|
@@ -2269,9 +2446,9 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2269
2446
|
* @brief Send point-to-point (P2P) binary message to a user.
|
|
2270
2447
|
* @param userId ID of the recipient
|
|
2271
2448
|
* @param message Binary message within 46 KB
|
|
2272
|
-
* @return
|
|
2273
|
-
*
|
|
2274
|
-
*
|
|
2449
|
+
* @return + Call login{@link #login} before calling this API.
|
|
2450
|
+
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]{@link #[EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]} if the message has been sent successfully.
|
|
2451
|
+
* @notes
|
|
2275
2452
|
*/
|
|
2276
2453
|
sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
|
|
2277
2454
|
|
|
@@ -2280,7 +2457,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2280
2457
|
* @param signature Dynamic signature.
|
|
2281
2458
|
* @param url Address of the IM server
|
|
2282
2459
|
* @return
|
|
2283
|
-
* @notes Call
|
|
2460
|
+
* @notes Call login{@link #login} before calling this API.
|
|
2284
2461
|
*/
|
|
2285
2462
|
setServerParams(signature: string, url: string): Promise<any>;
|
|
2286
2463
|
|
|
@@ -2288,7 +2465,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2288
2465
|
* @brief Send point-to-point (P2P) text message to the server.
|
|
2289
2466
|
* @param message Text message within 62 KB.
|
|
2290
2467
|
* @return
|
|
2291
|
-
* @notes
|
|
2468
|
+
* @notes
|
|
2292
2469
|
*/
|
|
2293
2470
|
sendServerMessage(message: string): Promise<any>;
|
|
2294
2471
|
|
|
@@ -2296,10 +2473,89 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2296
2473
|
* @brief Send point-to-point (P2P) binary message to the server.
|
|
2297
2474
|
* @param message Binary message within 46 KB.
|
|
2298
2475
|
* @return
|
|
2299
|
-
* @notes
|
|
2476
|
+
* @notes
|
|
2300
2477
|
*/
|
|
2301
2478
|
sendServerBinaryMessage(message: ArrayBuffer): Promise<any>;
|
|
2302
2479
|
|
|
2480
|
+
/**
|
|
2481
|
+
* @brief Start cloud proxy
|
|
2482
|
+
* @param cloudProxyInfo cloud proxy informarion list.
|
|
2483
|
+
* @notes <br>
|
|
2484
|
+
* + Call this API before joining the room.<br>
|
|
2485
|
+
* + Start pre-call network detection after starting cloud proxy. <br>
|
|
2486
|
+
* + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected). <br>
|
|
2487
|
+
* + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
|
|
2488
|
+
*/
|
|
2489
|
+
startCloudProxy(cloudProxyInfo: CloudProxyInfo): void;
|
|
2490
|
+
|
|
2491
|
+
/**
|
|
2492
|
+
* @brief Stop cloud proxy
|
|
2493
|
+
* @notes To start cloud proxy, call [startCloudProxy](#startCloudProxy).
|
|
2494
|
+
*/
|
|
2495
|
+
stopCloudProxy(): void;
|
|
2496
|
+
|
|
2497
|
+
/**
|
|
2498
|
+
* @brief Starts publishing a public media stream.
|
|
2499
|
+
* A public stream is a media stream that does not belong to any room or any user. Users with the same `appID` can call [startPlayPublicStream](#startplaypublicstream) to subscribe to and play the public stream.
|
|
2500
|
+
* @param publicStreamId The public stream's ID.
|
|
2501
|
+
* @param publicStreamParam The public stream's parameters.
|
|
2502
|
+
* A public stream can contain several media streams and will appears as the designated layout.
|
|
2503
|
+
* If the designated media stream is not published yet, the public stream will automatically update once the media stream is published.
|
|
2504
|
+
* @return
|
|
2505
|
+
* @notes + You cannot update the parameters of the public stream by repeatedly calling this API with the same stream ID by the same user. Call [updatePublicStreamParam](#updatepublicstreamparam) to update the parameters instead.
|
|
2506
|
+
* + Users with different `userID` can call this API with the same stream ID to update the parameters.
|
|
2507
|
+
* + Call this API with different stream ID to publish multiple public streams.
|
|
2508
|
+
* + Call [stopPushPublicStream](#stoppushpublicstream) to stop publishing the public stream.
|
|
2509
|
+
*/
|
|
2510
|
+
startPushPublicStream(publicStreamId: string, publicStreamParam: PublicStreamConfig): Promise<void>;
|
|
2511
|
+
|
|
2512
|
+
/**
|
|
2513
|
+
* @brief Update the properties of the public stream published by the current user.
|
|
2514
|
+
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
2515
|
+
* @param publicStreamId The public stream's ID.
|
|
2516
|
+
* The public stream must be published by the current user.
|
|
2517
|
+
* @param publicStreamParam The public stream's parameters.
|
|
2518
|
+
* @return
|
|
2519
|
+
*/
|
|
2520
|
+
updatePublicStreamParam(publicStreamId: string, publicStreamParam: Partial<PublicStreamConfig>): Promise<void>;
|
|
2521
|
+
|
|
2522
|
+
/**
|
|
2523
|
+
* @type api
|
|
2524
|
+
* @brief Stops publishing the public stream.
|
|
2525
|
+
* Call [startPushPublicStream](#startpushpublicstream) to start publishing a public stream.
|
|
2526
|
+
* @param publicStreamId The public stream's ID.
|
|
2527
|
+
* The public stream must be published by the current user.
|
|
2528
|
+
* @return
|
|
2529
|
+
*/
|
|
2530
|
+
stopPushPublicStream(publicStreamId: string): Promise<void>;
|
|
2531
|
+
|
|
2532
|
+
/**
|
|
2533
|
+
* @brief Subscribes to a designated public stream.
|
|
2534
|
+
* You can call this API to subscribe to a public stream whether you joined the room or not.
|
|
2535
|
+
* @param publicStreamId The public stream's ID.
|
|
2536
|
+
* If the designated stream is not published when you call this API, you will receive the public stream once it is published.
|
|
2537
|
+
* @return
|
|
2538
|
+
* @notes + Before calling this API, we recommend that you call [setPublicStreamVideoPlayer](#setpublicstreamvideoplayer) first to set the player information and rendering mode for the public stream.
|
|
2539
|
+
* + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
|
|
2540
|
+
* + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
|
|
2541
|
+
*/
|
|
2542
|
+
startPlayPublicStream(publicStreamId: string): Promise<void>;
|
|
2543
|
+
|
|
2544
|
+
/**
|
|
2545
|
+
* @brief Unsubscribes from a designated public stream.
|
|
2546
|
+
* Call [startPlayPublicStream](#startplaypublicstream) to subscribe to the public stream.
|
|
2547
|
+
* @param publicStreamId The public stream's ID.
|
|
2548
|
+
* @return
|
|
2549
|
+
*/
|
|
2550
|
+
stopPlayPublicStream(publicStreamId: string): Promise<void>;
|
|
2551
|
+
|
|
2552
|
+
/**
|
|
2553
|
+
* @brief Sets the player information and rendering mode for the public stream.
|
|
2554
|
+
* @param publicStreamId The public stream's ID.
|
|
2555
|
+
* @param videoPlayerOption Player information and rendering mode.
|
|
2556
|
+
*/
|
|
2557
|
+
setPublicStreamVideoPlayer(publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">): void;
|
|
2558
|
+
|
|
2303
2559
|
/**
|
|
2304
2560
|
* @brief Get the default parameters of `LiveTranscodeConfig`.
|
|
2305
2561
|
* @return The default parameters of `LiveTranscodeConfig`
|
|
@@ -2381,7 +2637,6 @@ export declare enum UserOfflineReason {
|
|
|
2381
2637
|
SWITCH_TO_INVISIBLE = 2,
|
|
2382
2638
|
|
|
2383
2639
|
/**
|
|
2384
|
-
* @hidden
|
|
2385
2640
|
* @brief The remote user has been removed from the room by the administrator via a OpenAPI call.
|
|
2386
2641
|
*/
|
|
2387
2642
|
KICKED_BY_ADMIN = 3
|
|
@@ -2419,7 +2674,6 @@ export interface RoomConfig {
|
|
|
2419
2674
|
}
|
|
2420
2675
|
|
|
2421
2676
|
/**
|
|
2422
|
-
* @hidden
|
|
2423
2677
|
* @brief Subscription mode
|
|
2424
2678
|
*/
|
|
2425
2679
|
export declare enum SubscribeMode {
|
|
@@ -2855,7 +3109,7 @@ export interface LiveTranscodeConfig {
|
|
|
2855
3109
|
url: string;
|
|
2856
3110
|
|
|
2857
3111
|
/**
|
|
2858
|
-
*
|
|
3112
|
+
* Audio transcoding related configurations.
|
|
2859
3113
|
*/
|
|
2860
3114
|
audio?: Partial<LiveTranscodeAudioConfig>;
|
|
2861
3115
|
|
|
@@ -3084,6 +3338,145 @@ export declare enum USER_ONLINE_STATUS {
|
|
|
3084
3338
|
UNREACHABLE = 2
|
|
3085
3339
|
}
|
|
3086
3340
|
|
|
3341
|
+
/**
|
|
3342
|
+
* @brief The media type of the public stream.
|
|
3343
|
+
*/
|
|
3344
|
+
export declare enum PublicStreamType {
|
|
3345
|
+
|
|
3346
|
+
/**
|
|
3347
|
+
* @brief Audio and video.
|
|
3348
|
+
*/
|
|
3349
|
+
AUDIO_AND_VIDEO = 0,
|
|
3350
|
+
|
|
3351
|
+
/**
|
|
3352
|
+
* @brief Audio only.
|
|
3353
|
+
*/
|
|
3354
|
+
AUDIO_ONLY = 1,
|
|
3355
|
+
|
|
3356
|
+
/**
|
|
3357
|
+
* @brief Video only.
|
|
3358
|
+
*/
|
|
3359
|
+
VIDEO_ONLY = 2
|
|
3360
|
+
}
|
|
3361
|
+
|
|
3362
|
+
/**
|
|
3363
|
+
* @brief Interpolation mode.
|
|
3364
|
+
*/
|
|
3365
|
+
export declare enum PublicInterpolationMode {
|
|
3366
|
+
|
|
3367
|
+
/**
|
|
3368
|
+
* @brief Intermediate with the last frame.
|
|
3369
|
+
*/
|
|
3370
|
+
PREV_FRAME = 0,
|
|
3371
|
+
|
|
3372
|
+
/**
|
|
3373
|
+
* @brief Intermediate with the background image or blank frames.
|
|
3374
|
+
*/
|
|
3375
|
+
OTHER_FRAME = 1
|
|
3376
|
+
}
|
|
3377
|
+
|
|
3378
|
+
/**
|
|
3379
|
+
* @brief Layout configuration of a media stream
|
|
3380
|
+
*/
|
|
3381
|
+
export declare type PublicStreamLayoutRegion = Omit<LiveTranscodeLayoutRegion, "isLocalUser" | "contentControl"> & {
|
|
3382
|
+
|
|
3383
|
+
/**
|
|
3384
|
+
* @brief Room ID of the user that publishes the media stream.
|
|
3385
|
+
*/
|
|
3386
|
+
roomId: string;
|
|
3387
|
+
|
|
3388
|
+
/**
|
|
3389
|
+
* @brief Media type of the public stream.
|
|
3390
|
+
*/
|
|
3391
|
+
mediaType?: PublicStreamType;
|
|
3392
|
+
|
|
3393
|
+
/**
|
|
3394
|
+
* @brief Configurations on how to crop the public stream
|
|
3395
|
+
*/
|
|
3396
|
+
sourceCrop?: {
|
|
3397
|
+
|
|
3398
|
+
/**
|
|
3399
|
+
* @brief The normalized horizontal coordinate value of the top left vertex of the cropped image to width of the original image, ranging within [0.0, 1.0).
|
|
3400
|
+
*/
|
|
3401
|
+
x: number;
|
|
3402
|
+
|
|
3403
|
+
/**
|
|
3404
|
+
* @brief The normalized vertical coordinate value of the top left vertex of the cropped image to height of the original image, ranging within [0.0, 1.0).
|
|
3405
|
+
*/
|
|
3406
|
+
y: number;
|
|
3407
|
+
|
|
3408
|
+
/**
|
|
3409
|
+
* @brief The normalized ratio of the width of the cropped image to that of the original image, ranging within [0.0, 1.0).
|
|
3410
|
+
*/
|
|
3411
|
+
w: number;
|
|
3412
|
+
|
|
3413
|
+
/**
|
|
3414
|
+
* @brief The normalized ratio of the height of the cropped image to that of the original image, ranging within [0.0, 1.0).
|
|
3415
|
+
*/
|
|
3416
|
+
h: number;
|
|
3417
|
+
};
|
|
3418
|
+
};
|
|
3419
|
+
|
|
3420
|
+
/**
|
|
3421
|
+
* @brief Configurations of the public stream.
|
|
3422
|
+
*/
|
|
3423
|
+
export interface PublicStreamConfig {
|
|
3424
|
+
|
|
3425
|
+
/**
|
|
3426
|
+
* @brief Video configurations.
|
|
3427
|
+
*/
|
|
3428
|
+
video?: {
|
|
3429
|
+
|
|
3430
|
+
/**
|
|
3431
|
+
* @brief Width, unit: px.
|
|
3432
|
+
* Valid for even numbers only. Assigning an odd number will lead to a failure of publishing a public stream.
|
|
3433
|
+
*/
|
|
3434
|
+
width?: number;
|
|
3435
|
+
|
|
3436
|
+
/**
|
|
3437
|
+
* @brief Height, unit: px.
|
|
3438
|
+
* Valid for even numbers only. Assigning an odd number will lead to a failure of publishing a public stream.
|
|
3439
|
+
*/
|
|
3440
|
+
height?: number;
|
|
3441
|
+
|
|
3442
|
+
/**
|
|
3443
|
+
* @brief Frame rate, unit: fps
|
|
3444
|
+
*/
|
|
3445
|
+
fps?: number;
|
|
3446
|
+
|
|
3447
|
+
/**
|
|
3448
|
+
* @brief Bitrate, unit: kbps<br>
|
|
3449
|
+
*/
|
|
3450
|
+
kBitRate: number;
|
|
3451
|
+
};
|
|
3452
|
+
|
|
3453
|
+
/**
|
|
3454
|
+
* @brief The layout mode of the public stream.
|
|
3455
|
+
*/
|
|
3456
|
+
layout?: {
|
|
3457
|
+
|
|
3458
|
+
/**
|
|
3459
|
+
* @brief Interpolation mode.
|
|
3460
|
+
*/
|
|
3461
|
+
interpolationMode?: PublicInterpolationMode;
|
|
3462
|
+
|
|
3463
|
+
/**
|
|
3464
|
+
* @brief Background color in hexadecimal.
|
|
3465
|
+
*/
|
|
3466
|
+
backgroundColor?: string;
|
|
3467
|
+
|
|
3468
|
+
/**
|
|
3469
|
+
* @brief Background image URL up to 1,024 bytes in length. The image format should be JPG, JPEG, or PNG.
|
|
3470
|
+
*/
|
|
3471
|
+
backgroundImage?: string;
|
|
3472
|
+
|
|
3473
|
+
/**
|
|
3474
|
+
* @brief Layout configuration of the public stream
|
|
3475
|
+
*/
|
|
3476
|
+
regions?: PublicStreamLayoutRegion[];
|
|
3477
|
+
};
|
|
3478
|
+
}
|
|
3479
|
+
|
|
3087
3480
|
/**
|
|
3088
3481
|
* @brief Point-to-point text message
|
|
3089
3482
|
*/
|
|
@@ -3131,12 +3524,32 @@ export interface LiveTranscodingResultEvent {
|
|
|
3131
3524
|
*/
|
|
3132
3525
|
message: string;
|
|
3133
3526
|
}
|
|
3527
|
+
|
|
3528
|
+
/**
|
|
3529
|
+
* @brief The result of publishing the public stream.
|
|
3530
|
+
*/
|
|
3531
|
+
export interface PublicStreamResultEvent {
|
|
3532
|
+
|
|
3533
|
+
/**
|
|
3534
|
+
* @brief Event number of publishing the public stream.
|
|
3535
|
+
*/
|
|
3536
|
+
code: number;
|
|
3537
|
+
|
|
3538
|
+
/**
|
|
3539
|
+
* @brief Event details of publishing the public stream.
|
|
3540
|
+
*/
|
|
3541
|
+
message: string;
|
|
3542
|
+
}
|
|
3543
|
+
export interface CloudProxyConnectedEvent {
|
|
3544
|
+
interval: number;
|
|
3545
|
+
}
|
|
3134
3546
|
declare const Config: {
|
|
3135
3547
|
VERSION: string;
|
|
3136
3548
|
ICE_CONFIG_REQUEST_URLS_INTERNAL: string[];
|
|
3137
3549
|
ICE_CONFIG_REQUEST_URLS: never[];
|
|
3138
3550
|
EXPECTED_ADDR: string;
|
|
3139
3551
|
LOG_SERVER_URL: string;
|
|
3552
|
+
CONFIG_REQUEST_DOMAINS: string[];
|
|
3140
3553
|
};
|
|
3141
3554
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
3142
3555
|
declare function getParameter(key: keyof typeof Config): string | string[] | never[];
|
|
@@ -3234,6 +3647,14 @@ export interface IVERTC {
|
|
|
3234
3647
|
* @region Engine Management
|
|
3235
3648
|
*/
|
|
3236
3649
|
isSupported: () => Promise<boolean>;
|
|
3650
|
+
|
|
3651
|
+
/**
|
|
3652
|
+
* @brief Gets the codec type supported by current browser.
|
|
3653
|
+
* If you have enabled vp8 codec, you can call the API to check whether the current browser supports vp8 encoding type before entering the room.
|
|
3654
|
+
* @return 当前浏览器支持的编解码类型
|
|
3655
|
+
* @region Engine Management
|
|
3656
|
+
*/
|
|
3657
|
+
getSupportedCodecs: () => Promise<string[]>;
|
|
3237
3658
|
}
|
|
3238
3659
|
declare class VERTC implements IVERTC {
|
|
3239
3660
|
getSdkVersion: () => string;
|
|
@@ -3253,6 +3674,7 @@ declare class VERTC implements IVERTC {
|
|
|
3253
3674
|
getParameter: typeof getParameter;
|
|
3254
3675
|
setParameter: typeof setParameter;
|
|
3255
3676
|
isSupported: () => Promise<boolean>;
|
|
3677
|
+
getSupportedCodecs: () => Promise<string[]>;
|
|
3256
3678
|
events: typeof EngineEventsTypes;
|
|
3257
3679
|
ErrorCode: typeof ErrorCode;
|
|
3258
3680
|
platform: string;
|