@rongcloud/plugin-rtc 5.2.2-alpha.1 → 5.2.4-beem.1
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 +76 -8
- package/dist/index.esm.js +327 -115
- package/dist/index.js +327 -115
- package/dist/index.umd.js +327 -115
- 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-beem.1
|
|
3
|
+
* CommitId - d026964c6715be7805a3e5c8addd64d4008d17bd
|
|
4
|
+
* Thu May 12 2022 18:57:27 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';
|
|
@@ -770,7 +770,7 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
770
770
|
* 另一种可能是己方 rtcPing 失败次数超出上限
|
|
771
771
|
* @param byServer 当值为 `false` 时,说明本端 rtcPing 超时;当值为 `true` 时,说明本端收到被踢出房间通知
|
|
772
772
|
*/
|
|
773
|
-
onKickOff?(byServer: boolean, state?: RCKickReason): void;
|
|
773
|
+
onKickOff?(byServer: boolean, state?: RCKickReason, kickExtra?: any): void;
|
|
774
774
|
/**
|
|
775
775
|
* 接收到房间信令时回调,用户可通过房间实例的 sendMessage 接口发送信令
|
|
776
776
|
* @param name 信令名
|
|
@@ -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;
|
|
@@ -2661,8 +2717,12 @@ declare class RCRTCClient {
|
|
|
2661
2717
|
/**
|
|
2662
2718
|
* 加入普通音视频房间
|
|
2663
2719
|
* @param roomId
|
|
2720
|
+
* @param joinType 多端处理方式
|
|
2721
|
+
* @param outerUserDatas 业务层设置人员属性
|
|
2722
|
+
* @param useMutilPeerC
|
|
2723
|
+
* @param roomType 加入房间的类型 默认参数 RTCMode.RTC
|
|
2664
2724
|
*/
|
|
2665
|
-
joinRTCRoom(roomId: string, joinType?: RTCJoinType): Promise<{
|
|
2725
|
+
joinRTCRoom(roomId: string, joinType?: RTCJoinType, outerUserDatas?: unknown, useMutilPeerC?: boolean, roomType?: RTCMode): Promise<{
|
|
2666
2726
|
room?: RCRTCRoom;
|
|
2667
2727
|
code: RCRTCCode;
|
|
2668
2728
|
userIds?: string[];
|
|
@@ -2797,6 +2857,10 @@ declare class RCRTCClient {
|
|
|
2797
2857
|
joinLivingRoomAsAudience(roomId: string, livingType: RCLivingType): Promise<{
|
|
2798
2858
|
room?: RCAudienceLivingRoom;
|
|
2799
2859
|
code: RCRTCCode;
|
|
2860
|
+
userIds?: string[];
|
|
2861
|
+
RTCTracks?: RCRemoteTrack[];
|
|
2862
|
+
MCUTracks?: RCRemoteTrack[];
|
|
2863
|
+
CDNUris?: IJoinResCDNInfo;
|
|
2800
2864
|
}>;
|
|
2801
2865
|
/**
|
|
2802
2866
|
* 观众退出并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
@@ -2819,6 +2883,10 @@ declare class RCRTCClient {
|
|
|
2819
2883
|
downgradeToAudienceRoom(room: RCLivingRoom): Promise<{
|
|
2820
2884
|
room?: RCAudienceLivingRoom;
|
|
2821
2885
|
code: RCRTCCode;
|
|
2886
|
+
userIds?: string[];
|
|
2887
|
+
RTCTracks?: RCRemoteTrack[];
|
|
2888
|
+
MCUTracks?: RCRemoteTrack[];
|
|
2889
|
+
CDNUris?: IJoinResCDNInfo;
|
|
2822
2890
|
}>;
|
|
2823
2891
|
/**
|
|
2824
2892
|
* 获取在房间内用户信息
|