@rongcloud/plugin-rtc 5.2.1 → 5.2.4
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/dist/index.d.ts +70 -6
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.2.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.2.4
|
|
3
|
+
* CommitId - d2c309074e678b96ebd403c0967994360e8b389c
|
|
4
|
+
* Fri Jan 28 2022 10:39:56 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IServerRTCRoomEntry, IJoinRTCRoomData, IReceivedMessage, KVString, RTCJoinType, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -910,6 +910,14 @@ interface IAudioLevelChangeHandler {
|
|
|
910
910
|
declare type RoomData = {
|
|
911
911
|
[userId: string]: IPublishedResource[];
|
|
912
912
|
};
|
|
913
|
+
/**
|
|
914
|
+
* 观众加房间返回给客户的 CDN 信息
|
|
915
|
+
*/
|
|
916
|
+
interface IJoinResCDNInfo {
|
|
917
|
+
resolution?: RCResolution;
|
|
918
|
+
fps?: RCFrameRate;
|
|
919
|
+
CDNEnable?: boolean;
|
|
920
|
+
}
|
|
913
921
|
|
|
914
922
|
declare enum RCInnerCDNPushMode {
|
|
915
923
|
AUTOMATIC = 0,
|
|
@@ -1076,6 +1084,15 @@ interface IExchangeResponse extends IRTCResponse {
|
|
|
1076
1084
|
* 主播发布为具体资源,会议模式为空数组
|
|
1077
1085
|
*/
|
|
1078
1086
|
mcuPublishList?: IResource[];
|
|
1087
|
+
/**
|
|
1088
|
+
* 订阅成功的资源
|
|
1089
|
+
*/
|
|
1090
|
+
subscribedList?: {
|
|
1091
|
+
mediaType: RCMediaType.AUDIO_ONLY | RCMediaType.VIDEO_ONLY;
|
|
1092
|
+
msid: string;
|
|
1093
|
+
userId: string;
|
|
1094
|
+
simulcast?: RCStreamType;
|
|
1095
|
+
}[];
|
|
1079
1096
|
}
|
|
1080
1097
|
interface IBroadcastSubReqBody {
|
|
1081
1098
|
/**
|
|
@@ -1677,9 +1694,21 @@ declare class RCAudienceLivingRoom {
|
|
|
1677
1694
|
private readonly _joinResData;
|
|
1678
1695
|
readonly _livingType: RCLivingType;
|
|
1679
1696
|
private readonly _service;
|
|
1697
|
+
/**
|
|
1698
|
+
* 主播列表
|
|
1699
|
+
*/
|
|
1680
1700
|
private _roomAnchorList;
|
|
1701
|
+
/**
|
|
1702
|
+
* 合流、分流资源
|
|
1703
|
+
*/
|
|
1681
1704
|
private _roomRes;
|
|
1705
|
+
/**
|
|
1706
|
+
* 主播分流资源
|
|
1707
|
+
*/
|
|
1682
1708
|
private _roomAnchorRes;
|
|
1709
|
+
/**
|
|
1710
|
+
* 合流、分流 remoteTracks
|
|
1711
|
+
*/
|
|
1683
1712
|
private _remoteTracks;
|
|
1684
1713
|
private _appListener;
|
|
1685
1714
|
private _pc;
|
|
@@ -1700,8 +1729,12 @@ declare class RCAudienceLivingRoom {
|
|
|
1700
1729
|
private _CDNUris;
|
|
1701
1730
|
constructor(_context: RTCPluginContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
|
|
1702
1731
|
token: string;
|
|
1703
|
-
kvEntries
|
|
1732
|
+
kvEntries: IServerRTCRoomEntry[];
|
|
1704
1733
|
}, _livingType: RCLivingType);
|
|
1734
|
+
/**
|
|
1735
|
+
* 解析服务端返回的 KV 数据,赋值 room 内数据
|
|
1736
|
+
*/
|
|
1737
|
+
private _setInitData;
|
|
1705
1738
|
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
1706
1739
|
/**
|
|
1707
1740
|
* @description 信令数据处理
|
|
@@ -1760,8 +1793,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1760
1793
|
private _diffCDNUris;
|
|
1761
1794
|
/**
|
|
1762
1795
|
* 获取 CDN 资源对应的拉流地址
|
|
1763
|
-
*
|
|
1764
|
-
* 业务层调用时使用内存中 _CDNUris 的 url,无 _CDNUris 时说明观众端未赋值过 _CDNUris
|
|
1796
|
+
* _CDNUris 无 url 时,说明未开启 CDN 推送
|
|
1765
1797
|
* @returns CDNPlayUrl
|
|
1766
1798
|
*/
|
|
1767
1799
|
private _getCDNPlayUrl;
|
|
@@ -1779,6 +1811,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1779
1811
|
*/
|
|
1780
1812
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
1781
1813
|
code: RCRTCCode;
|
|
1814
|
+
failedList?: ISubscribeAttr[];
|
|
1782
1815
|
}>;
|
|
1783
1816
|
private __unsubscribe;
|
|
1784
1817
|
/**
|
|
@@ -1787,6 +1820,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1787
1820
|
*/
|
|
1788
1821
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
1789
1822
|
code: RCRTCCode;
|
|
1823
|
+
failedList?: ISubscribeAttr[];
|
|
1790
1824
|
}>;
|
|
1791
1825
|
/**
|
|
1792
1826
|
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
@@ -1853,6 +1887,26 @@ declare class RCAudienceLivingRoom {
|
|
|
1853
1887
|
* @returns
|
|
1854
1888
|
*/
|
|
1855
1889
|
getRemoteTracks(): RCRemoteTrack[];
|
|
1890
|
+
/**
|
|
1891
|
+
* 获取远端 RTC tracks
|
|
1892
|
+
*/
|
|
1893
|
+
getRemoteRTCTracks(): RCRemoteTrack[];
|
|
1894
|
+
/**
|
|
1895
|
+
* 获取远端 MCU tracks
|
|
1896
|
+
*/
|
|
1897
|
+
getRemoteMCUTracks(): RCRemoteTrack[];
|
|
1898
|
+
/**
|
|
1899
|
+
* 获取房间内 CDN 信息
|
|
1900
|
+
*/
|
|
1901
|
+
getCDNInfo(): {
|
|
1902
|
+
resolution: RCResolution;
|
|
1903
|
+
fps: RCFrameRate;
|
|
1904
|
+
CDNEnable: boolean | undefined;
|
|
1905
|
+
} | {
|
|
1906
|
+
CDNEnable: boolean;
|
|
1907
|
+
resolution?: undefined;
|
|
1908
|
+
fps?: undefined;
|
|
1909
|
+
};
|
|
1856
1910
|
}
|
|
1857
1911
|
|
|
1858
1912
|
/**
|
|
@@ -2241,6 +2295,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2241
2295
|
*/
|
|
2242
2296
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
2243
2297
|
code: RCRTCCode;
|
|
2298
|
+
failedList?: ISubscribeAttr[];
|
|
2244
2299
|
}>;
|
|
2245
2300
|
private __subscribe;
|
|
2246
2301
|
/**
|
|
@@ -2249,6 +2304,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2249
2304
|
*/
|
|
2250
2305
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
2251
2306
|
code: RCRTCCode;
|
|
2307
|
+
failedList?: ISubscribeAttr[];
|
|
2252
2308
|
}>;
|
|
2253
2309
|
private __unsubscribe;
|
|
2254
2310
|
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
@@ -2797,6 +2853,10 @@ declare class RCRTCClient {
|
|
|
2797
2853
|
joinLivingRoomAsAudience(roomId: string, livingType: RCLivingType): Promise<{
|
|
2798
2854
|
room?: RCAudienceLivingRoom;
|
|
2799
2855
|
code: RCRTCCode;
|
|
2856
|
+
userIds?: string[];
|
|
2857
|
+
RTCTracks?: RCRemoteTrack[];
|
|
2858
|
+
MCUTracks?: RCRemoteTrack[];
|
|
2859
|
+
CDNUris?: IJoinResCDNInfo;
|
|
2800
2860
|
}>;
|
|
2801
2861
|
/**
|
|
2802
2862
|
* 观众退出并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
@@ -2819,6 +2879,10 @@ declare class RCRTCClient {
|
|
|
2819
2879
|
downgradeToAudienceRoom(room: RCLivingRoom): Promise<{
|
|
2820
2880
|
room?: RCAudienceLivingRoom;
|
|
2821
2881
|
code: RCRTCCode;
|
|
2882
|
+
userIds?: string[];
|
|
2883
|
+
RTCTracks?: RCRemoteTrack[];
|
|
2884
|
+
MCUTracks?: RCRemoteTrack[];
|
|
2885
|
+
CDNUris?: IJoinResCDNInfo;
|
|
2822
2886
|
}>;
|
|
2823
2887
|
/**
|
|
2824
2888
|
* 获取在房间内用户信息
|