@byteplus/rtc 4.41.3 → 4.43.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 +577 -81
- package/index.esm.min.js +2 -2
- package/index.min.js +2 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -15,16 +15,28 @@ declare enum ErrorCode {
|
|
|
15
15
|
INVALID_PARAMS = "INVALID_PARAMS",
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
* @brief Token
|
|
18
|
+
* @brief Invalid Token
|
|
19
19
|
*/
|
|
20
20
|
INVALID_TOKEN = "INVALID_TOKEN",
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @brief Token expired.
|
|
24
|
+
*/
|
|
21
25
|
EXPIRED_TOKEN = "EXPIRED_TOKEN",
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
28
|
* @brief Failure of joining room
|
|
25
29
|
*/
|
|
26
30
|
JOIN_ROOM_FAILED = "JOIN_ROOM_FAILED",
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @brief Fail to update Token failed because the Token is invalid.
|
|
34
|
+
*/
|
|
27
35
|
UPDATE_TOKEN_WITH_INVALID_TOKEN = "UPDATE_TOKEN_WITH_INVALID_TOKEN",
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @brief Fail to update Token failed because the user has not joined any room.
|
|
39
|
+
*/
|
|
28
40
|
UPDATE_TOKEN_BEFORE_JOIN = "UPDATE_TOKEN_BEFORE_JOIN",
|
|
29
41
|
|
|
30
42
|
/**
|
|
@@ -111,7 +123,6 @@ declare enum ErrorCode {
|
|
|
111
123
|
* @brief Users have been removed from the room because the administrator dismissed the room by calling OpenAPI.
|
|
112
124
|
*/
|
|
113
125
|
ROOM_DISMISS = "ROOM_DISMISS",
|
|
114
|
-
/** Token过期被踢出房间 */
|
|
115
126
|
|
|
116
127
|
/**
|
|
117
128
|
* @brief Token expired. Call `joinRoom` to rejoin with a valid Token.
|
|
@@ -247,6 +258,16 @@ declare enum ErrorCode {
|
|
|
247
258
|
*/
|
|
248
259
|
UNEXPECTED_ERROR = "UNEXPECTED_ERROR",
|
|
249
260
|
|
|
261
|
+
/**
|
|
262
|
+
* @brief You have started another device test while the current one is still ongoing.
|
|
263
|
+
*/
|
|
264
|
+
REPEAT_DEVICE_TEST = "REPEAT_DEVICE_TEST",
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* @brief The audio device test failed.
|
|
268
|
+
*/
|
|
269
|
+
AUDIO_DEVICE_TEST_FAILED = "AUDIO_DEVICE_RECORD_FAILED",
|
|
270
|
+
|
|
250
271
|
/**
|
|
251
272
|
* @brief The user has already logged in.
|
|
252
273
|
*/
|
|
@@ -345,7 +366,13 @@ declare enum ErrorCode {
|
|
|
345
366
|
/**
|
|
346
367
|
* @brief The user publishes a public stream before joining room.
|
|
347
368
|
*/
|
|
348
|
-
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN"
|
|
369
|
+
START_PUBLIC_STREAM_BEFORE_JOIN = "START_PUBLIC_STREAM_BEFORE_JOIN",
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* @brief Reconnection with the server fails and SDK will no longer automatically retry. <br>
|
|
373
|
+
* Please leave room first and join room again, or contact technical support.
|
|
374
|
+
*/
|
|
375
|
+
RECONNECT_FAILED = "RECONNECT_FAILED"
|
|
349
376
|
}
|
|
350
377
|
declare enum AudioMixingError {
|
|
351
378
|
|
|
@@ -676,6 +703,76 @@ export interface RTCDevice {
|
|
|
676
703
|
*/
|
|
677
704
|
deviceState: "active" | "inactive";
|
|
678
705
|
}
|
|
706
|
+
export interface AudioCodecProfile {
|
|
707
|
+
chn: number;
|
|
708
|
+
sr: number;
|
|
709
|
+
}
|
|
710
|
+
export interface IEngineBAC {
|
|
711
|
+
codec?: any;
|
|
712
|
+
play?: AudioCodecProfile;
|
|
713
|
+
record?: AudioCodecProfile;
|
|
714
|
+
agc?: any;
|
|
715
|
+
aec?: any;
|
|
716
|
+
ans?: any;
|
|
717
|
+
}
|
|
718
|
+
export interface IEngineANM {
|
|
719
|
+
enc_param: {
|
|
720
|
+
bitrate: number;
|
|
721
|
+
chn: number;
|
|
722
|
+
};
|
|
723
|
+
}
|
|
724
|
+
export interface IAudioConfig {
|
|
725
|
+
bitrate: number;
|
|
726
|
+
channel: number;
|
|
727
|
+
sampleRate: number;
|
|
728
|
+
agc: boolean;
|
|
729
|
+
aec: boolean;
|
|
730
|
+
ans: boolean;
|
|
731
|
+
}
|
|
732
|
+
declare class AudioProfileManager {
|
|
733
|
+
engineBAC: any;
|
|
734
|
+
engineANM: any;
|
|
735
|
+
bitrate?: number;
|
|
736
|
+
sampleRate?: number;
|
|
737
|
+
channel: number;
|
|
738
|
+
aec: boolean;
|
|
739
|
+
agc: boolean;
|
|
740
|
+
ans: boolean;
|
|
741
|
+
constructor();
|
|
742
|
+
private _init;
|
|
743
|
+
updateEngineBAC(newProfile?: IEngineBAC): void;
|
|
744
|
+
updateEngineANM(newProfile?: IEngineANM): void;
|
|
745
|
+
setAudioProfile(profile: AudioProfileType): void;
|
|
746
|
+
setBitrate(bitrate: number): void;
|
|
747
|
+
setAEC(enable: boolean): void;
|
|
748
|
+
setAGC(enable: boolean): void;
|
|
749
|
+
setANS(enable: boolean): void;
|
|
750
|
+
getOpusConfigStr(): string;
|
|
751
|
+
get config(): IAudioConfig;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* @brief Cloud proxy informatio
|
|
755
|
+
*/
|
|
756
|
+
export interface CloudProxyInfo {
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* @brief The cloud proxy IP of log report
|
|
760
|
+
*/
|
|
761
|
+
logProxy: string;
|
|
762
|
+
|
|
763
|
+
/**
|
|
764
|
+
* @brief The cloud proxy IP of the access
|
|
765
|
+
*/
|
|
766
|
+
accessProxy: string;
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* @brief The cloud proxy IP of RTC admin control
|
|
770
|
+
*/
|
|
771
|
+
configProxy: string;
|
|
772
|
+
}
|
|
773
|
+
export interface RTCContext {
|
|
774
|
+
audioProfileManager: AudioProfileManager;
|
|
775
|
+
}
|
|
679
776
|
|
|
680
777
|
/**
|
|
681
778
|
* A user joins the room
|
|
@@ -787,7 +884,12 @@ export interface onVideoFirstFrameDecodedEvent {
|
|
|
787
884
|
/**
|
|
788
885
|
* Event related to decoding the first video frame of the public stream.
|
|
789
886
|
*/
|
|
790
|
-
export declare type PublicStreamVideoFirstFrameDecodedEvent = Omit<
|
|
887
|
+
export declare type PublicStreamVideoFirstFrameDecodedEvent = Omit<
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* @brief Event related to the decoding of the first video frame.
|
|
891
|
+
*/
|
|
892
|
+
onVideoFirstFrameDecodedEvent, "userId"> & {
|
|
791
893
|
|
|
792
894
|
/**
|
|
793
895
|
* @brief The public stream's ID.
|
|
@@ -1376,6 +1478,8 @@ declare enum EngineEventsTypes {
|
|
|
1376
1478
|
* @brief Indication of audio volume
|
|
1377
1479
|
*/
|
|
1378
1480
|
onAudioVolumeIndication = "onAudioVolumeIndication",
|
|
1481
|
+
onLocalAudioPropertiesReport = "onLocalAudioPropertiesReport",
|
|
1482
|
+
onRemoteAudioPropertiesReport = "onRemoteAudioPropertiesReport",
|
|
1379
1483
|
|
|
1380
1484
|
/**
|
|
1381
1485
|
* @brief Callback of the state changing of audio playback devices
|
|
@@ -1408,6 +1512,7 @@ declare enum EngineEventsTypes {
|
|
|
1408
1512
|
* @brief The state of pushing streams to CDN
|
|
1409
1513
|
*/
|
|
1410
1514
|
onLiveTranscodingResult = "onLiveTranscodingResult",
|
|
1515
|
+
onAudioPlaybackDeviceTestVolume = "onAudioPlaybackDeviceTestVolume",
|
|
1411
1516
|
onSEIMessageReceived = "onSEIMessageReceived",
|
|
1412
1517
|
onError = "onError",
|
|
1413
1518
|
onAudioMixingStateChanged = "onAudioMixingStateChanged",
|
|
@@ -1547,6 +1652,84 @@ export interface AudioMixingStateChangedEvent {
|
|
|
1547
1652
|
error: AudioMixingError;
|
|
1548
1653
|
}
|
|
1549
1654
|
|
|
1655
|
+
/**
|
|
1656
|
+
* @brief Information about local audio <br>
|
|
1657
|
+
*/
|
|
1658
|
+
export interface LocalAudioPropertiesInfo {
|
|
1659
|
+
|
|
1660
|
+
/**
|
|
1661
|
+
* @brief Indicates whether the audio is captured by microphone or from screen sharing. <br>
|
|
1662
|
+
*/
|
|
1663
|
+
streamIndex: StreamIndex;
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* @type keytype
|
|
1667
|
+
* @brief Audio information <br>
|
|
1668
|
+
*/
|
|
1669
|
+
audioPropertiesInfo: AudioPropertiesInfo;
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
/**
|
|
1673
|
+
* @brief Information about remote audio <br>
|
|
1674
|
+
*/
|
|
1675
|
+
export interface RemoteAudioPropertiesInfo {
|
|
1676
|
+
|
|
1677
|
+
/**
|
|
1678
|
+
* @brief Information about remote stream <br>
|
|
1679
|
+
*/
|
|
1680
|
+
streamKey: StreamKey;
|
|
1681
|
+
|
|
1682
|
+
/**
|
|
1683
|
+
* @brief Information about remote audio properties <br>
|
|
1684
|
+
*/
|
|
1685
|
+
audioPropertiesInfo: AudioPropertiesInfo;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* @brief Audio information <br>
|
|
1690
|
+
*/
|
|
1691
|
+
export interface AudioPropertiesInfo {
|
|
1692
|
+
|
|
1693
|
+
/**
|
|
1694
|
+
* @brief linear volume. The value is in linear relation to the original volume. The higher the value, the higher the volume. The range is [0,255]. <br>
|
|
1695
|
+
* - [0, 25]: Silence <br>
|
|
1696
|
+
* - [26, 75]: Low volume <br>
|
|
1697
|
+
* - [76, 204]: Medium volume <br>
|
|
1698
|
+
* - [205, 255]: High volume <br>
|
|
1699
|
+
*/
|
|
1700
|
+
linearVolume: number;
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* @brief non-linear volume in dB. The value is in proportion to the log value of the original volume. You can use the value to recognize the Active Speaker in the room. The range is [-127, 0]. <br>
|
|
1704
|
+
* - [-127, -60]: Silence <br>
|
|
1705
|
+
* - [-59, -40]: Low volume <br>
|
|
1706
|
+
* - [-39, -20]: Medium volume <br>
|
|
1707
|
+
* - [-19, 0]: High volume <br>
|
|
1708
|
+
*/
|
|
1709
|
+
nonlinearVolume: number;
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
/**
|
|
1713
|
+
* @brief Information about the remote stream
|
|
1714
|
+
*/
|
|
1715
|
+
export interface StreamKey {
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* @brief ID of the room from which the stream is published.
|
|
1719
|
+
*/
|
|
1720
|
+
roomId: string;
|
|
1721
|
+
|
|
1722
|
+
/**
|
|
1723
|
+
* @brief ID of the user who publishes the stream.
|
|
1724
|
+
*/
|
|
1725
|
+
userId: string;
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* @brief Indicates whether the audio is captured by microphone or from screen sharing. <br>
|
|
1729
|
+
*/
|
|
1730
|
+
streamIndex: StreamIndex;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1550
1733
|
/**
|
|
1551
1734
|
* @list 104477
|
|
1552
1735
|
* @detail 104479
|
|
@@ -1583,10 +1766,14 @@ export interface IEngineEvents {
|
|
|
1583
1766
|
|
|
1584
1767
|
/**
|
|
1585
1768
|
* @brief A new stream added into the room.
|
|
1586
|
-
* @param event
|
|
1769
|
+
* @param event
|
|
1587
1770
|
* @region Room Management Event
|
|
1588
1771
|
*/
|
|
1589
1772
|
[EngineEventsTypes.onStreamAdd]: (event: {
|
|
1773
|
+
|
|
1774
|
+
/**
|
|
1775
|
+
* @brief `stream` object.
|
|
1776
|
+
*/
|
|
1590
1777
|
stream: RTCStream;
|
|
1591
1778
|
}) => void;
|
|
1592
1779
|
|
|
@@ -1606,11 +1793,19 @@ export interface IEngineEvents {
|
|
|
1606
1793
|
|
|
1607
1794
|
/**
|
|
1608
1795
|
* @brief Users will receive this event when a user in the room pauses/ resumes publishing audio stream.
|
|
1609
|
-
* @param event
|
|
1796
|
+
* @param event
|
|
1610
1797
|
* @region Room Management Event
|
|
1611
1798
|
*/
|
|
1612
1799
|
[EngineEventsTypes.onStreamRemove]: (event: {
|
|
1800
|
+
|
|
1801
|
+
/**
|
|
1802
|
+
* @brief Media stream
|
|
1803
|
+
*/
|
|
1613
1804
|
stream: RTCStream;
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* @brief Reason
|
|
1808
|
+
*/
|
|
1614
1809
|
reason: StreamRemoveReason;
|
|
1615
1810
|
}) => void;
|
|
1616
1811
|
|
|
@@ -1651,31 +1846,55 @@ export interface IEngineEvents {
|
|
|
1651
1846
|
|
|
1652
1847
|
/**
|
|
1653
1848
|
* @brief Event of media track ending
|
|
1654
|
-
* @param event
|
|
1849
|
+
* @param event
|
|
1655
1850
|
* @region Video Management Event
|
|
1656
1851
|
*/
|
|
1657
1852
|
[EngineEventsTypes.onTrackEnded]: (event: {
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* @brief Type of the trac
|
|
1856
|
+
*/
|
|
1658
1857
|
kind: string;
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* @brief Whether it is a screen-sharing stream.
|
|
1861
|
+
*/
|
|
1659
1862
|
isScreen: boolean;
|
|
1660
1863
|
}) => void;
|
|
1661
1864
|
|
|
1662
1865
|
/**
|
|
1663
1866
|
* @brief Event of receiving a broadcast text message in the room
|
|
1664
|
-
* @param event
|
|
1867
|
+
* @param event
|
|
1665
1868
|
* @region Message Event
|
|
1666
1869
|
*/
|
|
1667
1870
|
[EngineEventsTypes.onRoomMessageReceived]: (event: {
|
|
1871
|
+
|
|
1872
|
+
/**
|
|
1873
|
+
* @brief userID of the message sender.
|
|
1874
|
+
*/
|
|
1668
1875
|
userId: string;
|
|
1876
|
+
|
|
1877
|
+
/**
|
|
1878
|
+
* @brief Contents of the message.
|
|
1879
|
+
*/
|
|
1669
1880
|
message: any;
|
|
1670
1881
|
}) => void;
|
|
1671
1882
|
|
|
1672
1883
|
/**
|
|
1673
1884
|
* @brief Event of receiving a broadcast binary message in the room
|
|
1674
|
-
* @param event
|
|
1885
|
+
* @param event
|
|
1675
1886
|
* @region Message Event
|
|
1676
1887
|
*/
|
|
1677
1888
|
[EngineEventsTypes.onRoomBinaryMessageReceived]: (event: {
|
|
1889
|
+
|
|
1890
|
+
/**
|
|
1891
|
+
* @brief userID of the message sender
|
|
1892
|
+
*/
|
|
1678
1893
|
userId: string;
|
|
1894
|
+
|
|
1895
|
+
/**
|
|
1896
|
+
* @brief Contents of the message
|
|
1897
|
+
*/
|
|
1679
1898
|
message: ArrayBuffer;
|
|
1680
1899
|
}) => void;
|
|
1681
1900
|
|
|
@@ -1708,21 +1927,43 @@ export interface IEngineEvents {
|
|
|
1708
1927
|
[EngineEventsTypes.onLocalStreamStats]: (stats: LocalStreamStats) => void;
|
|
1709
1928
|
|
|
1710
1929
|
/**
|
|
1711
|
-
* @brief
|
|
1930
|
+
* @brief This 2 s periodical callback notifies information of the public stream after calling [startPlayPublicStream](104478#startplaypublicstream).
|
|
1712
1931
|
* @param stats
|
|
1713
1932
|
*/
|
|
1714
1933
|
[EngineEventsTypes.onPublicStreamStats]: (stats: PublicStreamStats) => void;
|
|
1715
1934
|
|
|
1716
1935
|
/**
|
|
1936
|
+
* @hidden
|
|
1937
|
+
* @deprecated since 4.42, use onLocalAudioPropertiesReport and onRemoteAudioPropertiesReport instead.
|
|
1717
1938
|
* @brief Volume of each of the users in the room
|
|
1718
1939
|
* If the user has not joined a room, the list will only include volume of `local_user`.
|
|
1719
|
-
* @param event
|
|
1940
|
+
* @param event
|
|
1720
1941
|
* @region Room Event
|
|
1721
1942
|
*/
|
|
1722
1943
|
[EngineEventsTypes.onAudioVolumeIndication]: (event: {
|
|
1944
|
+
|
|
1945
|
+
/**
|
|
1946
|
+
* @brief Active user in the room and his/her volume.
|
|
1947
|
+
*/
|
|
1723
1948
|
speakers: AudioVolumeInfo[];
|
|
1724
1949
|
}) => void;
|
|
1725
1950
|
|
|
1951
|
+
/**
|
|
1952
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about local audio. <br>
|
|
1953
|
+
* Local audio includes the microphone audio and the screen audio captured using RTC SDK internal mechanisms. <br>
|
|
1954
|
+
* @param event Information about local audio. <br>
|
|
1955
|
+
* @region Audio Managment <br>
|
|
1956
|
+
*/
|
|
1957
|
+
[EngineEventsTypes.onLocalAudioPropertiesReport]: (event: LocalAudioPropertiesInfo[]) => void;
|
|
1958
|
+
|
|
1959
|
+
/**
|
|
1960
|
+
* @brief After calling [enableAudioPropertiesReport](104478#enableAudioPropertiesReport), you will periodically receive this callback for the information about the subscribed remote audio streams. <br>
|
|
1961
|
+
* The remote audio streams includes the microphone audio and screen audio collected using the RTC SDK internal mechanism/custom mechanism. <br>
|
|
1962
|
+
* @param event Information about remote audio. <br>
|
|
1963
|
+
* @region Audio Management
|
|
1964
|
+
*/
|
|
1965
|
+
[EngineEventsTypes.onRemoteAudioPropertiesReport]: (event: RemoteAudioPropertiesInfo[]) => void;
|
|
1966
|
+
|
|
1726
1967
|
/**
|
|
1727
1968
|
* @brief The current playback device has been changed successfully by calling [setAudioPlaybackDevice](104478#setAudioPlaybackDevice).
|
|
1728
1969
|
* @param event Information of the media devices. Refer to the [official documentation](https://developer.mozilla.org/en-US/docs/Web/API/MediaDeviceInfo) for more details.
|
|
@@ -1732,37 +1973,53 @@ export interface IEngineEvents {
|
|
|
1732
1973
|
|
|
1733
1974
|
/**
|
|
1734
1975
|
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts audio capture by calling [startAudioCapture](104478#startAudioCapture).
|
|
1735
|
-
* @param event
|
|
1976
|
+
* @param event
|
|
1736
1977
|
* @region Audio Management Event
|
|
1737
1978
|
*/
|
|
1738
1979
|
[EngineEventsTypes.onUserStartAudioCapture]: (event: {
|
|
1980
|
+
|
|
1981
|
+
/**
|
|
1982
|
+
* @brief The publisher who starts the internal audio capture
|
|
1983
|
+
*/
|
|
1739
1984
|
userId: string;
|
|
1740
1985
|
}) => void;
|
|
1741
1986
|
|
|
1742
1987
|
/**
|
|
1743
1988
|
* @brief The remote clients in the room will be informed of the state change via this event after the publisher stops audio capture by calling [stopAudioCapture](104478#stopAudioCapture).
|
|
1744
|
-
* @param event
|
|
1989
|
+
* @param event
|
|
1745
1990
|
* @region Room Management Event
|
|
1746
1991
|
*/
|
|
1747
1992
|
[EngineEventsTypes.onUserStopAudioCapture]: (event: {
|
|
1993
|
+
|
|
1994
|
+
/**
|
|
1995
|
+
* @brief The userId of the publisher who stops the internal audio capture.
|
|
1996
|
+
*/
|
|
1748
1997
|
userId: string;
|
|
1749
1998
|
}) => void;
|
|
1750
1999
|
|
|
1751
2000
|
/**
|
|
1752
2001
|
* @brief The remote clients in the room will be informed of the state change via this event after the publisher starts video capture by calling [startVideoCapture](104478#startVideoCapture).
|
|
1753
|
-
* @param event
|
|
2002
|
+
* @param event
|
|
1754
2003
|
* @region Room Management Event
|
|
1755
2004
|
*/
|
|
1756
2005
|
[EngineEventsTypes.onUserStartVideoCapture]: (event: {
|
|
2006
|
+
|
|
2007
|
+
/**
|
|
2008
|
+
* @brief The userId of the publisher who starts the internal video capture.
|
|
2009
|
+
*/
|
|
1757
2010
|
userId: string;
|
|
1758
2011
|
}) => void;
|
|
1759
2012
|
|
|
1760
2013
|
/**
|
|
1761
2014
|
The remote clients in the room will be informed of the state change via this event after the publisher stops video capture by calling [stopVideoCapture](104478#stopVideoCapture).
|
|
1762
|
-
* @param event
|
|
2015
|
+
* @param event
|
|
1763
2016
|
* @region Room Management Event
|
|
1764
2017
|
*/
|
|
1765
2018
|
[EngineEventsTypes.onUserStopVideoCapture]: (event: {
|
|
2019
|
+
|
|
2020
|
+
/**
|
|
2021
|
+
* @brief The userId of the publisher who stops the internal video capture.
|
|
2022
|
+
*/
|
|
1766
2023
|
userId: string;
|
|
1767
2024
|
}) => void;
|
|
1768
2025
|
|
|
@@ -1775,22 +2032,42 @@ export interface IEngineEvents {
|
|
|
1775
2032
|
|
|
1776
2033
|
/**
|
|
1777
2034
|
* @brief Result of the Auto-Subscription
|
|
1778
|
-
* @param event
|
|
2035
|
+
* @param event
|
|
1779
2036
|
* @region Room Management Event
|
|
1780
2037
|
*/
|
|
1781
2038
|
[EngineEventsTypes.onAutoSubscribeResult]: (event: {
|
|
2039
|
+
|
|
2040
|
+
/**
|
|
2041
|
+
* @brief The userId of the publisher to be subscribed
|
|
2042
|
+
*/
|
|
1782
2043
|
userId: string;
|
|
2044
|
+
|
|
2045
|
+
/**
|
|
2046
|
+
* @brief Wether it is a screen-sharing stream
|
|
2047
|
+
*/
|
|
1783
2048
|
isScreen: boolean;
|
|
2049
|
+
|
|
2050
|
+
/**
|
|
2051
|
+
* @brief Subscription state.
|
|
2052
|
+
*/
|
|
1784
2053
|
state: SubscribeState;
|
|
1785
2054
|
}) => void;
|
|
1786
2055
|
|
|
1787
2056
|
/**
|
|
1788
2057
|
* @brief Result of Auto-publishing. You will receive this event if you enable Auto-publish when calling `joinRoom`
|
|
1789
|
-
* @param event
|
|
2058
|
+
* @param event
|
|
1790
2059
|
* @region Room Management Event
|
|
1791
2060
|
*/
|
|
1792
2061
|
[EngineEventsTypes.onAutoPublishResult]: (event: {
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* @brief Wether it is a screen-sharing stream
|
|
2065
|
+
*/
|
|
1793
2066
|
isScreen: boolean;
|
|
2067
|
+
|
|
2068
|
+
/**
|
|
2069
|
+
* @brief Publish state.
|
|
2070
|
+
*/
|
|
1794
2071
|
state: PublishState;
|
|
1795
2072
|
}) => void;
|
|
1796
2073
|
|
|
@@ -1810,11 +2087,15 @@ export interface IEngineEvents {
|
|
|
1810
2087
|
|
|
1811
2088
|
/**
|
|
1812
2089
|
* @brief event of error
|
|
1813
|
-
* @param event
|
|
2090
|
+
* @param event
|
|
1814
2091
|
* @region Room Management Event
|
|
1815
2092
|
*/
|
|
1816
2093
|
[EngineEventsTypes.onError]: (event: {
|
|
1817
|
-
|
|
2094
|
+
|
|
2095
|
+
/**
|
|
2096
|
+
* @brief The reason why the current user has been removed from the room.
|
|
2097
|
+
*/
|
|
2098
|
+
errorCode: ErrorCode.DUPLICATE_LOGIN | ErrorCode.RTM_DUPLICATE_LOGIN | ErrorCode.RTM_TOKEN_ERROR | ErrorCode.EXPIRED_TOKEN | ErrorCode.RECONNECT_FAILED;
|
|
1818
2099
|
}) => void;
|
|
1819
2100
|
|
|
1820
2101
|
/**
|
|
@@ -1837,6 +2118,11 @@ export interface IEngineEvents {
|
|
|
1837
2118
|
* @region Message Event
|
|
1838
2119
|
*/
|
|
1839
2120
|
[EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]: (event: UserBinaryMessageEvent) => void;
|
|
2121
|
+
|
|
2122
|
+
/**
|
|
2123
|
+
* @brief You will receive this callback 30 s before the Token expires.
|
|
2124
|
+
* Call [updateToken](104478#updatetoken) to submit a new Token。The user will be removed from the room when the Token expires.
|
|
2125
|
+
*/
|
|
1840
2126
|
[EngineEventsTypes.onTokenWillExpire]: () => void;
|
|
1841
2127
|
|
|
1842
2128
|
/**
|
|
@@ -1847,7 +2133,7 @@ export interface IEngineEvents {
|
|
|
1847
2133
|
|
|
1848
2134
|
/**
|
|
1849
2135
|
* @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.
|
|
2136
|
+
* After calling [startPushPublicStream](104478#startpushpublicstream), you will be informed of the result through this callback.
|
|
1851
2137
|
* @param event
|
|
1852
2138
|
*/
|
|
1853
2139
|
[EngineEventsTypes.onPushPublicStreamResult]: (event: PublicStreamResultEvent) => void;
|
|
@@ -1855,7 +2141,7 @@ export interface IEngineEvents {
|
|
|
1855
2141
|
/**
|
|
1856
2142
|
* @hidden
|
|
1857
2143
|
* @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.
|
|
2144
|
+
* You will receive SEI by this callback if the public stream you subscribed to by calling [startPlayPublicStream](104478#startplaypublicstream) is carrying SEI.
|
|
1859
2145
|
* @param event
|
|
1860
2146
|
* @notes When multiple streams in the public stream contain SEI:
|
|
1861
2147
|
* + You will receive SEI from all the video frames if the SEI do not have conflicts.
|
|
@@ -1865,44 +2151,31 @@ export interface IEngineEvents {
|
|
|
1865
2151
|
|
|
1866
2152
|
/**
|
|
1867
2153
|
* @brief Callback of the successful decoding of the first video frame of the public stream.
|
|
1868
|
-
* Refer to [startPlayPublicStream](#startplaypublicstream) for details about
|
|
2154
|
+
* Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
|
|
1869
2155
|
* @param event
|
|
1870
2156
|
*/
|
|
1871
2157
|
[EngineEventsTypes.onFirstPublicStreamVideoFrameDecoded]: (event: PublicStreamVideoFirstFrameDecodedEvent) => void;
|
|
1872
2158
|
|
|
1873
2159
|
/**
|
|
1874
2160
|
* @brief Callback of the successful decoding of the first audio frame of the public stream.
|
|
1875
|
-
* Refer to [startPlayPublicStream](#startplaypublicstream) for details about
|
|
2161
|
+
* Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
|
|
1876
2162
|
* @param event
|
|
1877
2163
|
*/
|
|
1878
2164
|
[EngineEventsTypes.onFirstPublicStreamAudioFrameDecoded]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
|
|
1879
2165
|
|
|
1880
2166
|
/**
|
|
1881
2167
|
* @brief Callback of the successful rendering of the first video frame of the public stream.
|
|
2168
|
+
* Refer to [startPlayPublicStream](104478#startplaypublicstream) for details about subscribing to a public stream.
|
|
1882
2169
|
* @param event
|
|
1883
2170
|
*/
|
|
1884
2171
|
[EngineEventsTypes.onFirstPublicStreamVideoFrameRendered]: (event: PublicStreamAudioFirstFrameDecodedEvent) => void;
|
|
1885
|
-
}
|
|
1886
|
-
|
|
1887
|
-
/**
|
|
1888
|
-
* @brief Cloud proxy informatio
|
|
1889
|
-
*/
|
|
1890
|
-
export interface CloudProxyInfo {
|
|
1891
2172
|
|
|
1892
2173
|
/**
|
|
1893
|
-
* @brief
|
|
2174
|
+
* @brief Notification on the playing volume during the test for the local audio devices
|
|
2175
|
+
* @param volume playing volume during the test for the local audio devices in milliseconds. We recommend to set it to 200 ms.The range is [0,255].
|
|
2176
|
+
* @notes Start an audio-device test by calling [startAudioPlaybackDeviceTest](104478#startaudioplaybackdevicetest) or [startAudioDeviceRecordTest](104478#startaudiodevicerecordtest) will register this callback for regular notification on playing volume. You can set the time interval between each callback by passing a proper value when calling the API above.
|
|
1894
2177
|
*/
|
|
1895
|
-
|
|
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;
|
|
2178
|
+
[EngineEventsTypes.onAudioPlaybackDeviceTestVolume]: (volume: number) => void;
|
|
1906
2179
|
}
|
|
1907
2180
|
|
|
1908
2181
|
/**
|
|
@@ -2001,11 +2274,11 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2001
2274
|
|
|
2002
2275
|
/**
|
|
2003
2276
|
* @brief Update Token. <br>
|
|
2004
|
-
*
|
|
2277
|
+
* You will receive [onTokenWillExpire](104479#ontokenwillexpire) 30 s before the Token expires. Call this API to submit a new Token.
|
|
2005
2278
|
* @param token A valid token <br>
|
|
2006
2279
|
* @notes + If you call [joinRoom](#joinroom) with an expired token, the joining will fail with an error code `INVALID_TOKEN`. And you need to obtain a valid token and call this API to update the token. <br>
|
|
2007
2280
|
* + If joining a room failed because the token expired, call this API with an updated token. And then RTC SDK will automatically rejoin the room without calling [joinRoom](#joinroom) again. <br>
|
|
2008
|
-
* +
|
|
2281
|
+
* + The user will be removed from the room when the Token expires.
|
|
2009
2282
|
* @region Room Management
|
|
2010
2283
|
*/
|
|
2011
2284
|
updateToken(token: string): void;
|
|
@@ -2029,17 +2302,17 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2029
2302
|
switchCamera(deviceId: string): Promise<void>;
|
|
2030
2303
|
|
|
2031
2304
|
/**
|
|
2032
|
-
* @brief Enable internal video capture. The default state is off.
|
|
2305
|
+
* @brief Enable internal video capture. The default state is off.
|
|
2033
2306
|
* Internal video capture refers to: capturing video using the built-in module.
|
|
2034
|
-
* The remote clients in the room will be informed of the state change via [onUserStartVideoCapture](104479#onuserstartvideocapture) after the publisher starts video capture by calling this API
|
|
2307
|
+
* The remote clients in the room will be informed of the state change via [onUserStartVideoCapture](104479#onuserstartvideocapture) after the publisher starts video capture by calling this API.
|
|
2035
2308
|
* @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
|
|
2036
|
-
* @return
|
|
2309
|
+
* @return The actual effective video capture parameters. See [MediaTrackSettings](https://developer.mozilla.org/en-US/docs/Web/API/MediaTrackConstraints). Pay attention to the properties: `frameRate`, `height`, and `width`.
|
|
2037
2310
|
* @notes + Call [stopVideoCapture](#stopvideocapture) to stop the internal video capture. Otherwise, the internal video capture will sustain until you destroy the engine instance.<br>
|
|
2038
2311
|
* + Once you create the engine instance, you can start internal video capture regardless of the video publishing state. The video stream will start publishing only after the video capture starts. <br>
|
|
2039
2312
|
* + Call [switchCamera](#switchcamera) to switch the camera used by the internal video capture module.<br>
|
|
2040
2313
|
* @region Video Management
|
|
2041
2314
|
*/
|
|
2042
|
-
startVideoCapture(deviceId?: string): Promise<
|
|
2315
|
+
startVideoCapture(deviceId?: string): Promise<MediaTrackSettings>;
|
|
2043
2316
|
|
|
2044
2317
|
/**
|
|
2045
2318
|
* @brief Enable internal video capture immediately. The default setting is off. <br>
|
|
@@ -2058,7 +2331,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2058
2331
|
* The remote clients in the room will be informed of the state change via [onUserStartAudioCapture](104479#onuserstartaudiocapture) after the publisher starts audio capture by calling this API.
|
|
2059
2332
|
* @param deviceId ID of the device need to enable which you can call [getDevices](#getdevices) to obtain.
|
|
2060
2333
|
* @return
|
|
2061
|
-
* @notes + Call [
|
|
2334
|
+
* @notes + Call [stopAudioCapture](#stopaudiocapture) to stop the internal audio capture. Otherwise, the internal audio capture will sustain until you destroy the engine instance. <br>
|
|
2062
2335
|
* + Once you create the engine instance, you can start internal audio capture regardless of the audio publishing state. The audio stream will start publishing only after the audio capture starts. <br>
|
|
2063
2336
|
* @region Audio Management
|
|
2064
2337
|
*/
|
|
@@ -2259,17 +2532,28 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2259
2532
|
sendSEIMessage(streamIndex: StreamIndex, message: Uint8Array | string, repeatCount: number): void;
|
|
2260
2533
|
|
|
2261
2534
|
/**
|
|
2262
|
-
* @
|
|
2535
|
+
* @region Video Management
|
|
2536
|
+
* @brief Sets the video encoder configuration of the publishing streams.
|
|
2263
2537
|
* @param streamIndex
|
|
2264
|
-
* @param descriptions
|
|
2265
|
-
*
|
|
2266
|
-
*
|
|
2267
|
-
*
|
|
2268
|
-
* @region Media Transmission
|
|
2538
|
+
* @param descriptions The max parameters of the video stream.
|
|
2539
|
+
* When you call [enableSimulcastMode](#enableSimulcastMode) and enable simulcasting, you can call this API to set the parameters of the multiple video streams. The length of `descriptions` is no more than 3. The code rate of the parameters must be in descending order.
|
|
2540
|
+
* When the resolution of the max stream is in [540P, 1080P], you can simulcast 3 streams; when in [270P, 450P], you can simulcast 2 streams; when in [0, 180P], you can not enable simulcast.
|
|
2541
|
+
* @notes For the video stream captured by the camera, the default value is 360P, 15FPS; for the screen-sharing stream, the default value is 1080P, 15FPS.
|
|
2269
2542
|
*/
|
|
2270
|
-
setVideoEncoderConfig(streamIndex: StreamIndex, descriptions: VideoEncoderConfig[]): Promise<void>;
|
|
2543
|
+
setVideoEncoderConfig(streamIndex: StreamIndex, descriptions: VideoEncoderConfig | VideoEncoderConfig[]): Promise<void>;
|
|
2271
2544
|
|
|
2272
2545
|
/**
|
|
2546
|
+
* @region Video Management
|
|
2547
|
+
* @brief Enables the simulcast mode of the video stream captured by the camera at the publishing end.imulcasting, including resolution, frame rate, bitrate, scale mode, fallback strategy under poor network conditions.
|
|
2548
|
+
* @param enabled
|
|
2549
|
+
* @param + You must call this API before publishing the video streams. <br>
|
|
2550
|
+
* + After enabling the simulcast mode, SDK automatically sets the encoding parameters for the video streams. For manual setting, call [setVideoEncoderConfig](#setVideoEncoderConfig).
|
|
2551
|
+
*/
|
|
2552
|
+
enableSimulcastMode(enabled: boolean): boolean;
|
|
2553
|
+
|
|
2554
|
+
/**
|
|
2555
|
+
* @hidden
|
|
2556
|
+
* @deprecated since 4.42, use enableAudioPropertiesReport instead
|
|
2273
2557
|
* @brief Turn on/off volume prompts. Off by default. <br>
|
|
2274
2558
|
* Call this API to set the report period of the volume information of local user and each subscribed user.
|
|
2275
2559
|
* Local client will get informed of the the volume of local user and each subscribed users via [onAudioVolumeIndication](104479#onaudiovolumeindication).
|
|
@@ -2281,6 +2565,16 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2281
2565
|
*/
|
|
2282
2566
|
setAudioVolumeIndicationInterval(interval?: number): void;
|
|
2283
2567
|
|
|
2568
|
+
/**
|
|
2569
|
+
* @brief Enable audio information prompts. <br>
|
|
2570
|
+
* @param config Audio information prompts-related configurations. <br>
|
|
2571
|
+
* @notes With the prompt on, you can: <br>
|
|
2572
|
+
* + Get the information of the audio stream captured by the local microphone and screen audio stream through [onLocalAudioPropertiesReport](104479#onLocalAudioPropertiesReport). <br>
|
|
2573
|
+
* + Get the information of the subscribed remote audio streams through [onRemoteAudioPropertiesReport](104479#onRemoteAudioPropertiesReport).
|
|
2574
|
+
* @region Audio Management
|
|
2575
|
+
*/
|
|
2576
|
+
enableAudioPropertiesReport(config?: AudioPropertiesConfig): void;
|
|
2577
|
+
|
|
2284
2578
|
/**
|
|
2285
2579
|
* @brief Starts pushing media streams to CDN and sets the relevant configurations.
|
|
2286
2580
|
* @param transcode configuration for push media streams to CDN.
|
|
@@ -2403,7 +2697,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2403
2697
|
* @param userInfo User information.
|
|
2404
2698
|
* @return
|
|
2405
2699
|
* @notes
|
|
2406
|
-
* + Call logout
|
|
2700
|
+
* + Call [logout](104478@#logout) to log out the IM server.
|
|
2407
2701
|
* + 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`.
|
|
2408
2702
|
* @region Room Management
|
|
2409
2703
|
*/
|
|
@@ -2419,7 +2713,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2419
2713
|
* @brief Update the Token used to login. Since all tokens have a limited time-to-live, call this API to refresh the token.
|
|
2420
2714
|
* @param token updated token
|
|
2421
2715
|
* @return
|
|
2422
|
-
* @notes + Call this API to refresh the token after the token has expired with no need for calling login
|
|
2716
|
+
* @notes + Call this API to refresh the token after the token has expired with no need for calling [login](#login).
|
|
2423
2717
|
* + 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.
|
|
2424
2718
|
*/
|
|
2425
2719
|
updateLoginToken(token: string | null): Promise<void>;
|
|
@@ -2428,7 +2722,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2428
2722
|
* @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.
|
|
2429
2723
|
* @param userId ID of the user whose status intended to know
|
|
2430
2724
|
* @return
|
|
2431
|
-
* @notes Call login
|
|
2725
|
+
* @notes Call [login](104478@#login) before calling this API.
|
|
2432
2726
|
*/
|
|
2433
2727
|
getPeerOnlineStatus(userId: string): Promise<USER_ONLINE_STATUS>;
|
|
2434
2728
|
|
|
@@ -2437,8 +2731,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2437
2731
|
* @param userId ID of the recipient
|
|
2438
2732
|
* @param message Text message within 62 KB.
|
|
2439
2733
|
* @return
|
|
2440
|
-
* @notes + Call login
|
|
2441
|
-
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserMessageReceivedOutsideRoom]
|
|
2734
|
+
* @notes + Call [login](104478@#login) before calling this API.
|
|
2735
|
+
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserMessageReceivedOutsideRoom](104479#onUserMessageReceivedOutsideRoom) if the message has been sent successfully.
|
|
2442
2736
|
*/
|
|
2443
2737
|
sendUserMessageOutsideRoom(userId: string, message: string): Promise<any>;
|
|
2444
2738
|
|
|
@@ -2446,8 +2740,8 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2446
2740
|
* @brief Send point-to-point (P2P) binary message to a user.
|
|
2447
2741
|
* @param userId ID of the recipient
|
|
2448
2742
|
* @param message Binary message within 46 KB
|
|
2449
|
-
* @return + Call login
|
|
2450
|
-
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom]
|
|
2743
|
+
* @return + Call [login](#login) before calling this API.
|
|
2744
|
+
* + The recipient must be logged into the server and will receive the text message via [EngineEventsTypes.onUserBinaryMessageReceivedOutsideRoom](104479#onuserbinarymessagereceivedoutsideroom) if the message has been sent successfully.
|
|
2451
2745
|
* @notes
|
|
2452
2746
|
*/
|
|
2453
2747
|
sendUserBinaryMessageOutsideRoom(userId: string, message: ArrayBuffer): Promise<any>;
|
|
@@ -2457,7 +2751,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2457
2751
|
* @param signature Dynamic signature.
|
|
2458
2752
|
* @param url Address of the IM server
|
|
2459
2753
|
* @return
|
|
2460
|
-
* @notes Call login
|
|
2754
|
+
* @notes Call [login](#login) before calling this API.
|
|
2461
2755
|
*/
|
|
2462
2756
|
setServerParams(signature: string, url: string): Promise<any>;
|
|
2463
2757
|
|
|
@@ -2480,8 +2774,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2480
2774
|
/**
|
|
2481
2775
|
* @brief Start cloud proxy
|
|
2482
2776
|
* @param cloudProxyInfo cloud proxy informarion list.
|
|
2483
|
-
* @notes
|
|
2484
|
-
* + Call this API before joining the room.<br>
|
|
2777
|
+
* @notes + Call this API before joining the room.<br>
|
|
2485
2778
|
* + Start pre-call network detection after starting cloud proxy. <br>
|
|
2486
2779
|
* + After starting cloud proxy and connects the cloud proxy server successfully, receives [onCloudProxyConnected](104479#onCloudProxyConnected). <br>
|
|
2487
2780
|
* + To stop cloud proxy, call [stopCloudProxy](#stopCloudProxy).
|
|
@@ -2536,7 +2829,7 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2536
2829
|
* If the designated stream is not published when you call this API, you will receive the public stream once it is published.
|
|
2537
2830
|
* @return
|
|
2538
2831
|
* @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.
|
|
2832
|
+
* + After calling this API, you will receive [onFirstPublicStreamVideoFrameDecoded](104479#onfirstpublicstreamvideoframedecoded) and [onFirstPublicStreamAudioFrameDecoded](104479#onfirstpublicstreamaudioframedecoded) once the first frame has been decoded.
|
|
2540
2833
|
* + Call [stopPlayPublicStream](#stopplaypublicstream) to unsubscribing from the public stream.
|
|
2541
2834
|
*/
|
|
2542
2835
|
startPlayPublicStream(publicStreamId: string): Promise<void>;
|
|
@@ -2556,11 +2849,71 @@ export interface IRTCEngine extends EnhancedEventEmitter<IEngineEvents> {
|
|
|
2556
2849
|
*/
|
|
2557
2850
|
setPublicStreamVideoPlayer(publicStreamId: string, videoPlayerOption: Omit<VideoPlayerOption, "userId">): void;
|
|
2558
2851
|
|
|
2852
|
+
/**
|
|
2853
|
+
* @region Video Management
|
|
2854
|
+
* @brief Set the placeholder image during local video capture pause
|
|
2855
|
+
* @param index
|
|
2856
|
+
* @param filePath Image path in Http protocal; or Blob object.
|
|
2857
|
+
* The format of the image can be: JPG, PNG, or BMP.
|
|
2858
|
+
* When the ratio of the image is not the same as the video encoder configuration, the image will be resized with fixed ratio until the width and the height are no more than that of the encoder configuration.
|
|
2859
|
+
* @return + It's recommended to call this API before stopping video capture to avoid blank frame in video recording. <br>
|
|
2860
|
+
* + You cannot see the image during local preview.
|
|
2861
|
+
*/
|
|
2862
|
+
setDummyCaptureImagePath(index: StreamIndex, filePath: string): Promise<void>;
|
|
2863
|
+
|
|
2559
2864
|
/**
|
|
2560
2865
|
* @brief Get the default parameters of `LiveTranscodeConfig`.
|
|
2561
2866
|
* @return The default parameters of `LiveTranscodeConfig`
|
|
2562
2867
|
*/
|
|
2563
2868
|
defaultTranscoding(): Required<LiveTranscodeConfig>;
|
|
2869
|
+
|
|
2870
|
+
/**
|
|
2871
|
+
* @brief Start the playback test for the local audio device. RTC will start playing the audio file specified. And RTC will notify the audio volume via the [onAudioPlaybackDeviceTestVolume](104479#onaudioplaybackdevicetestvolume) periodically.
|
|
2872
|
+
* @param filePath Specify the path of the audio file for the playback test, including *.wav and *.mp3.
|
|
2873
|
+
* @param indicationInterval The time interval between each callback in milliseconds. We recommend setting it to 200 ms. The minimal value is 100 ms.
|
|
2874
|
+
* @return Resolve when the test ends.
|
|
2875
|
+
* @notes + You can call this API whether the user is in the room.
|
|
2876
|
+
* + Call [stopAudioPlaybackDeviceTest](#stopaudioplaybackdevicetest) to stop the playback test before moving on to the other device tests.
|
|
2877
|
+
*/
|
|
2878
|
+
startAudioPlaybackDeviceTest(filePath: string, indicationInterval: number): Promise<void>;
|
|
2879
|
+
|
|
2880
|
+
/**
|
|
2881
|
+
* @brief Stop the playback test for the local audio device.
|
|
2882
|
+
* @notes Call this API to stop the playback test started by calling [startAudioPlaybackDeviceTest](#startaudioplaybackdevicetest) before moving on to the other device tests.
|
|
2883
|
+
*/
|
|
2884
|
+
stopAudioPlaybackDeviceTest(): void;
|
|
2885
|
+
|
|
2886
|
+
/**
|
|
2887
|
+
* @brief Start the capture and playback test for local audio devices.
|
|
2888
|
+
* We recommend to register [onLocalAudioPropertiesReport](104479#onlocalaudiopropertiesreport) callback via [enableAudioPropertiesReport](enableaudiopropertiesreport). Once the test starts, you can get the volume of the capturing audio by this callback.
|
|
2889
|
+
* @param indicationInterval The time interval between each callback of [onAudioPlaybackDeviceTestVolume](104479#onaudioplaybackdevicetestvolume) via which you get informed of the playback volume during the test. We recommend setting it to 200 ms. The minimal value is 100 ms.
|
|
2890
|
+
* @return Resolve when the test ends.
|
|
2891
|
+
* @notes + You can call this API whether the user is in a room.
|
|
2892
|
+
* + The audio capturing will stop and begins to play the recording in 30 s after calling this API. Before that, call [stopAudioDeviceRecordAndPlayTest](#stopaudiodevicerecordandplayTest) to stop capturing and start playing the recording.
|
|
2893
|
+
* + You must stop the test before starting another test for audio devices.
|
|
2894
|
+
* + Call [stopAudioDeviceRecordTest](#stopaudiodevicerecordtest) to stop the test, including capturing and playing the recording.
|
|
2895
|
+
* + This test performs locally and does not involve network connection testing.
|
|
2896
|
+
*/
|
|
2897
|
+
startAudioDeviceRecordTest(indicationInterval: number): Promise<void>;
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* @brief Call this API to stop recording in the test and start to play the recording.
|
|
2901
|
+
* @notes After calling this API, the recording starts playing during which you can call [stopAudioDeviceRecordTest](#stopaudiodevicerecordtest) to stop playing.
|
|
2902
|
+
*/
|
|
2903
|
+
stopAudioDeviceRecordAndPlayTest(): void;
|
|
2904
|
+
|
|
2905
|
+
/**
|
|
2906
|
+
* @brief Stop the capture and playback test for local audio devices which is started by calling [startAudioDeviceRecordTest](#startaudiodevicerecordtest).
|
|
2907
|
+
* Before the test ends by itself, you can call this API to stop the recording or playing.
|
|
2908
|
+
*/
|
|
2909
|
+
stopAudioDevicePlayTest(): void;
|
|
2910
|
+
|
|
2911
|
+
/**
|
|
2912
|
+
* @brief Set the sound quality.
|
|
2913
|
+
* @param profile A sound quality option consists of a set of audio profiles and applying each brings a different listening experience. Choose the appropriate audio quality to meet the requirement of the scenario.
|
|
2914
|
+
* @notes We recommend to call this API before the audio capture starts.
|
|
2915
|
+
*/
|
|
2916
|
+
setAudioProfile(profile: AudioProfileType): void;
|
|
2564
2917
|
}
|
|
2565
2918
|
|
|
2566
2919
|
/**
|
|
@@ -2657,6 +3010,7 @@ export interface RoomConfig {
|
|
|
2657
3010
|
|
|
2658
3011
|
/**
|
|
2659
3012
|
* @brief Enable/disable auto-subscribe audio. Enable by default.
|
|
3013
|
+
* Call publish[104481#publish] to publish media streams if you disable `isAutoPublish`.
|
|
2660
3014
|
*/
|
|
2661
3015
|
isAutoPublish: boolean;
|
|
2662
3016
|
|
|
@@ -2671,6 +3025,13 @@ export interface RoomConfig {
|
|
|
2671
3025
|
* Call subscribeUserStream, unsubscribe to revise the subscription.
|
|
2672
3026
|
*/
|
|
2673
3027
|
isAutoSubscribeVideo: boolean;
|
|
3028
|
+
|
|
3029
|
+
/**
|
|
3030
|
+
* @brief Room profile<br>
|
|
3031
|
+
* Choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
|
|
3032
|
+
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
|
|
3033
|
+
*/
|
|
3034
|
+
roomProfileType: RoomProfileType;
|
|
2674
3035
|
}
|
|
2675
3036
|
|
|
2676
3037
|
/**
|
|
@@ -2716,12 +3077,12 @@ export interface SubscribeConfig {
|
|
|
2716
3077
|
export declare enum MuteState {
|
|
2717
3078
|
|
|
2718
3079
|
/**
|
|
2719
|
-
* @brief
|
|
3080
|
+
* @brief Disable
|
|
2720
3081
|
*/
|
|
2721
3082
|
MUTE_STATE_OFF = 0,
|
|
2722
3083
|
|
|
2723
3084
|
/**
|
|
2724
|
-
* @brief
|
|
3085
|
+
* @brief Enable
|
|
2725
3086
|
*/
|
|
2726
3087
|
MUTE_STATE_ON = 1
|
|
2727
3088
|
}
|
|
@@ -2806,7 +3167,7 @@ export interface VideoPlayerOption {
|
|
|
2806
3167
|
renderDom?: string | HTMLElement;
|
|
2807
3168
|
|
|
2808
3169
|
/**
|
|
2809
|
-
* @brief Rendering modes: optional `RENDER_MODE_HIDDEN
|
|
3170
|
+
* @brief Rendering modes: optional `RENDER_MODE_HIDDEN` and `RENDER_MODE_FIT` .
|
|
2810
3171
|
*/
|
|
2811
3172
|
renderMode?: VideoRenderMode;
|
|
2812
3173
|
|
|
@@ -3071,6 +3432,21 @@ export interface ScreenConfig {
|
|
|
3071
3432
|
*/
|
|
3072
3433
|
export interface VideoEncoderConfig {
|
|
3073
3434
|
|
|
3435
|
+
/**
|
|
3436
|
+
* @brief width in px
|
|
3437
|
+
*/
|
|
3438
|
+
width: number;
|
|
3439
|
+
|
|
3440
|
+
/**
|
|
3441
|
+
* @brief height in px
|
|
3442
|
+
*/
|
|
3443
|
+
height: number;
|
|
3444
|
+
|
|
3445
|
+
/**
|
|
3446
|
+
* @brief frame rate
|
|
3447
|
+
*/
|
|
3448
|
+
frameRate: number;
|
|
3449
|
+
|
|
3074
3450
|
/**
|
|
3075
3451
|
* @brief The max bitrate, unit: kbps
|
|
3076
3452
|
*/
|
|
@@ -3098,6 +3474,27 @@ export declare enum MirrorType {
|
|
|
3098
3474
|
MIRROR_TYPE_RENDER = 1
|
|
3099
3475
|
}
|
|
3100
3476
|
|
|
3477
|
+
/**
|
|
3478
|
+
* @brief Configuration related to audio information prompt. <br>
|
|
3479
|
+
*/
|
|
3480
|
+
export interface AudioPropertiesConfig {
|
|
3481
|
+
|
|
3482
|
+
/**
|
|
3483
|
+
* @brief Prompt interval in ms, the default value is 100. <br>
|
|
3484
|
+
* + `<= 0`: Turn off prompt <br>
|
|
3485
|
+
* + `(0,100]`: Invalid interval value, and will be automatically reset to 100ms. <br>
|
|
3486
|
+
* + `> 100`: The actual value of interval <br>
|
|
3487
|
+
*/
|
|
3488
|
+
interval?: number;
|
|
3489
|
+
|
|
3490
|
+
/**
|
|
3491
|
+
* @brief Whether to keep audio information prompt on when you are not on the video/audio call webpage. The default setting is `true`. <br>
|
|
3492
|
+
* + true: Keep the prompt on <br>
|
|
3493
|
+
* + false: Disable the prompt <br>
|
|
3494
|
+
*/
|
|
3495
|
+
enableInBackground?: boolean;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3101
3498
|
/**
|
|
3102
3499
|
* @brief Configurations to be set when pushing media streams to CDN
|
|
3103
3500
|
*/
|
|
@@ -3203,7 +3600,7 @@ export interface LiveTranscodeAudioConfig {
|
|
|
3203
3600
|
channels: number;
|
|
3204
3601
|
|
|
3205
3602
|
/**
|
|
3206
|
-
* @brief The AAC profile to be set. The value must be `LC`, `HEv1`,
|
|
3603
|
+
* @brief The AAC profile to be set. The value must be `LC`, `HEv1`, or `HEv2`. The default value is `LC`.
|
|
3207
3604
|
*/
|
|
3208
3605
|
AACProfile: "LC" | "HEv1" | "HEv2";
|
|
3209
3606
|
}
|
|
@@ -3477,6 +3874,97 @@ export interface PublicStreamConfig {
|
|
|
3477
3874
|
};
|
|
3478
3875
|
}
|
|
3479
3876
|
|
|
3877
|
+
/**
|
|
3878
|
+
* @brief Room profile<br>
|
|
3879
|
+
* While calling [joinRoom](104478#joinroom) choose an appropriate room-profile option to meet the requirement of the scenario for media encoding algorithm, video profiles, and network configurations.
|
|
3880
|
+
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option if it is necessary.
|
|
3881
|
+
*/
|
|
3882
|
+
export declare enum RoomProfileType {
|
|
3883
|
+
|
|
3884
|
+
/**
|
|
3885
|
+
* @brief Default mode for video/audio calls, such as voice chat room
|
|
3886
|
+
*/
|
|
3887
|
+
communication = 0,
|
|
3888
|
+
|
|
3889
|
+
/**
|
|
3890
|
+
* @brief For 1 v.s. 1 audio and video calls
|
|
3891
|
+
*/
|
|
3892
|
+
chat = 5,
|
|
3893
|
+
|
|
3894
|
+
/**
|
|
3895
|
+
* @brief Audio and video chat for 3 or more people
|
|
3896
|
+
*/
|
|
3897
|
+
chatRoom = 6,
|
|
3898
|
+
|
|
3899
|
+
/**
|
|
3900
|
+
* @brief For the event of co-hosting during live streaming broadcast
|
|
3901
|
+
*/
|
|
3902
|
+
coHost = 9,
|
|
3903
|
+
|
|
3904
|
+
/**
|
|
3905
|
+
* @brief For meeting Apps installed on terminals of meeting rooms
|
|
3906
|
+
*/
|
|
3907
|
+
meeting = 16,
|
|
3908
|
+
|
|
3909
|
+
/**
|
|
3910
|
+
* @brief For the online classrooms and lectures that over 9 participants can join the audio and video chat.
|
|
3911
|
+
*/
|
|
3912
|
+
classRoom = 18
|
|
3913
|
+
}
|
|
3914
|
+
|
|
3915
|
+
/**
|
|
3916
|
+
* @brief Audio quality
|
|
3917
|
+
* Call [setAudioProfile](104478#setaudioprofile) to choose an audio quality option.
|
|
3918
|
+
*/
|
|
3919
|
+
export declare enum AudioProfileType {
|
|
3920
|
+
|
|
3921
|
+
/**
|
|
3922
|
+
* @brief Default sound quality
|
|
3923
|
+
* The sound quality configuration of RoomProfileType{@link #RoomProfileType} set by the server or client side
|
|
3924
|
+
*/
|
|
3925
|
+
default = 0,
|
|
3926
|
+
|
|
3927
|
+
/**
|
|
3928
|
+
* @brief Smooth <br>
|
|
3929
|
+
* Sample rate: 16 KHz<br>
|
|
3930
|
+
* Mono-channel<br>
|
|
3931
|
+
* Encoding birrate: 24 Kpbs
|
|
3932
|
+
* Fluent priority, low power consumption, and low traffic consumption, suitable for most game scenarios, such as team-wide voice chat, group-wide voice chat, nation-wide voice chat.
|
|
3933
|
+
*/
|
|
3934
|
+
fluent = 1,
|
|
3935
|
+
|
|
3936
|
+
/**
|
|
3937
|
+
* @brief Mono-channel standard <br>
|
|
3938
|
+
* Sample rate: 48 KHz<br>
|
|
3939
|
+
* Encoding bitrate: 48 Kpbs<br>
|
|
3940
|
+
* For scenarios requiring distinct voice, you can choose this mode, which achieves balanced latency, consumption, and network packets. It is suitable for educational Apps and the online Mafia Games.
|
|
3941
|
+
*/
|
|
3942
|
+
standard = 2,
|
|
3943
|
+
|
|
3944
|
+
/**
|
|
3945
|
+
* @brief Dual-channel music <br>
|
|
3946
|
+
* Sample rate: 48 KHz<br>
|
|
3947
|
+
* Encoding birrate: 128 Kpbs<br>
|
|
3948
|
+
* This mode provides high-resolution audio at a cost of high latency, consumption, and large network packets. It is suitable for entertainment Apps such as co-hosting and online talent contests. <br>
|
|
3949
|
+
* Not recommended for game Apps.
|
|
3950
|
+
*/
|
|
3951
|
+
hd = 3,
|
|
3952
|
+
|
|
3953
|
+
/**
|
|
3954
|
+
* @brief Dual-channel standard <br>
|
|
3955
|
+
* Sample rate: 48 KHz<br>
|
|
3956
|
+
* Encoding birrate: 80 Kpbs
|
|
3957
|
+
*/
|
|
3958
|
+
standardStereo = 4,
|
|
3959
|
+
|
|
3960
|
+
/**
|
|
3961
|
+
* @brief Mono-channel music <br>
|
|
3962
|
+
* Sample rate: 48 KHz<br>
|
|
3963
|
+
* Encoding birrate: 128 Kpbs<br>
|
|
3964
|
+
*/
|
|
3965
|
+
hdMono = 5
|
|
3966
|
+
}
|
|
3967
|
+
|
|
3480
3968
|
/**
|
|
3481
3969
|
* @brief Point-to-point text message
|
|
3482
3970
|
*/
|
|
@@ -3550,9 +4038,10 @@ declare const Config: {
|
|
|
3550
4038
|
EXPECTED_ADDR: string;
|
|
3551
4039
|
LOG_SERVER_URL: string;
|
|
3552
4040
|
CONFIG_REQUEST_DOMAINS: string[];
|
|
4041
|
+
DEVICE_ID: string;
|
|
3553
4042
|
};
|
|
3554
4043
|
declare function setParameter(key: keyof typeof Config, value: any): void;
|
|
3555
|
-
declare function getParameter(key: keyof typeof Config): string | string[]
|
|
4044
|
+
declare function getParameter(key: keyof typeof Config): string | string[];
|
|
3556
4045
|
/**
|
|
3557
4046
|
* @list 104477
|
|
3558
4047
|
* @detail 104478
|
|
@@ -3564,10 +4053,10 @@ declare function getParameter(key: keyof typeof Config): string | string[] | nev
|
|
|
3564
4053
|
export interface IVERTC {
|
|
3565
4054
|
|
|
3566
4055
|
/**
|
|
3567
|
-
* @brief Call this API to create an IRTCEngine instance that provides RTC service.
|
|
3568
|
-
* Call this API before calling any other APIs within the RTC SDK
|
|
4056
|
+
* @brief Call this API to create an IRTCEngine instance that provides RTC service.
|
|
4057
|
+
* Call this API before calling any other APIs within the RTC SDK.
|
|
3569
4058
|
* Calling this API repeatedly will create multiple IRTCEngine instances.
|
|
3570
|
-
* @param appId A unique identifier for each application. You can apply appIDs on the RTC console.
|
|
4059
|
+
* @param appId A unique identifier for each application. You can apply appIDs on the RTC console.
|
|
3571
4060
|
* Instances generated by different AppIDs are independent in RTC service. Users served by one AppID cannot communicate with users served by another AppID.
|
|
3572
4061
|
* @return Return an `IRTCEngine` instance if you call this API successfully.
|
|
3573
4062
|
* @notes + Call [destroyEngine](#destroyengine) respectively to destroy each IRTCEngine instance.
|
|
@@ -3579,7 +4068,7 @@ export interface IVERTC {
|
|
|
3579
4068
|
/**
|
|
3580
4069
|
* @brief Call this API to destroy the IRTCEngine instance created by [createEngine](#createengine).
|
|
3581
4070
|
* @param engine By calling this API, this `IRTCEngine` instance and resource related will be wiped from memory. And any interaction with the media server will end.
|
|
3582
|
-
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
|
|
4071
|
+
* @notes + Before calling this API, ensure all business scenarios related to this `IRTCEngine` instance have ended.
|
|
3583
4072
|
* + Calling this API will block the main thread until it completes the exiting process. Therefore, do not include this API in a callback. Nor wait in a callback for the execution of this API in the main thread, thus causing a deadlock.
|
|
3584
4073
|
* @region Engine Management
|
|
3585
4074
|
*/
|
|
@@ -3603,12 +4092,20 @@ export interface IVERTC {
|
|
|
3603
4092
|
/**
|
|
3604
4093
|
* @brief Call this API to request for access to video and audio devices.
|
|
3605
4094
|
* @param options The device type you need
|
|
3606
|
-
*
|
|
3607
|
-
*
|
|
4095
|
+
* @return + `video: boolean` Video devices
|
|
4096
|
+
* + `audio:boolean` Audio devices
|
|
3608
4097
|
* @region Device Management
|
|
3609
4098
|
*/
|
|
3610
4099
|
enableDevices: (options?: {
|
|
4100
|
+
|
|
4101
|
+
/**
|
|
4102
|
+
* @brief Video devices
|
|
4103
|
+
*/
|
|
3611
4104
|
video: boolean;
|
|
4105
|
+
|
|
4106
|
+
/**
|
|
4107
|
+
* @brief Audio devices
|
|
4108
|
+
*/
|
|
3612
4109
|
audio: boolean;
|
|
3613
4110
|
}) => Promise<{
|
|
3614
4111
|
video: boolean;
|
|
@@ -3641,9 +4138,8 @@ export interface IVERTC {
|
|
|
3641
4138
|
|
|
3642
4139
|
/**
|
|
3643
4140
|
* @brief Call this API to check whether the browser is supported.
|
|
3644
|
-
* @return
|
|
3645
|
-
* + `
|
|
3646
|
-
* - `False`: Not Supported
|
|
4141
|
+
* @return + `True`: Supported
|
|
4142
|
+
* + `False`: Not Supported
|
|
3647
4143
|
* @region Engine Management
|
|
3648
4144
|
*/
|
|
3649
4145
|
isSupported: () => Promise<boolean>;
|
|
@@ -3651,7 +4147,7 @@ export interface IVERTC {
|
|
|
3651
4147
|
/**
|
|
3652
4148
|
* @brief Gets the codec type supported by current browser.
|
|
3653
4149
|
* 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
|
|
4150
|
+
* @return Codec types supported by the current browser
|
|
3655
4151
|
* @region Engine Management
|
|
3656
4152
|
*/
|
|
3657
4153
|
getSupportedCodecs: () => Promise<string[]>;
|