@rongcloud/plugin-rtc 5.5.4-alpha.1 → 5.5.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.
Files changed (114) hide show
  1. package/dist/async-task-queue.d.ts +9 -0
  2. package/dist/core/Invoker.d.ts +55 -0
  3. package/dist/core/PolarisReporter.d.ts +36 -0
  4. package/dist/core/RCAudienceClient.d.ts +90 -0
  5. package/dist/core/RCMediaStreamCapture.d.ts +124 -0
  6. package/dist/core/RCRTCClient.d.ts +148 -0
  7. package/dist/core/Store.d.ts +86 -0
  8. package/dist/core/codec/RTCContext.d.ts +76 -0
  9. package/dist/core/codec/interface.d.ts +168 -0
  10. package/dist/core/codec/proto.d.ts +94 -0
  11. package/dist/core/codec/rtc-helper.d.ts +17 -0
  12. package/dist/core/command/AsyncCommand.d.ts +55 -0
  13. package/dist/core/command/AsyncSubscribeCommand.d.ts +28 -0
  14. package/dist/core/command/AsyncUnsubscribeCommand.d.ts +28 -0
  15. package/dist/core/command/AsyncUpdateSubscribeListCommand.d.ts +25 -0
  16. package/dist/core/command/BaseCommand.d.ts +31 -0
  17. package/dist/core/command/EnabelInnerCDNCommand.d.ts +16 -0
  18. package/dist/core/command/ExchangeCommand.d.ts +18 -0
  19. package/dist/core/command/ExchangeWithPushOtherRoomCommand.d.ts +22 -0
  20. package/dist/core/command/JoinRoomCommand.d.ts +31 -0
  21. package/dist/core/command/LeaveOtherRoomCommand.d.ts +32 -0
  22. package/dist/core/command/LocalTrackMuteCommand.d.ts +18 -0
  23. package/dist/core/command/MCUConfigFlushCommand.d.ts +18 -0
  24. package/dist/core/command/OnRemoteUserUnpubCommand.d.ts +13 -0
  25. package/dist/core/command/OnSignalReconnectedCommand.d.ts +38 -0
  26. package/dist/core/command/ParseRemoteResCommand.d.ts +38 -0
  27. package/dist/core/command/ParseUserStateCommand.d.ts +57 -0
  28. package/dist/core/command/PubCommand.d.ts +34 -0
  29. package/dist/core/command/PublishCommand.d.ts +36 -0
  30. package/dist/core/command/RTCIdentityChangeCommand.d.ts +18 -0
  31. package/dist/core/command/RetryExchangeCommand.d.ts +18 -0
  32. package/dist/core/command/SubscribeCommand.d.ts +21 -0
  33. package/dist/core/command/UnpublishCommand.d.ts +22 -0
  34. package/dist/core/command/UnpublishPrevCommand.d.ts +11 -0
  35. package/dist/core/command/UnsubscribeCommand.d.ts +20 -0
  36. package/dist/core/command/UpdateSubscribeListCommand.d.ts +28 -0
  37. package/dist/core/command/helper.d.ts +20 -0
  38. package/dist/core/constants.d.ts +4 -0
  39. package/dist/core/enums/BackgroundPictureFillMode.d.ts +14 -0
  40. package/dist/core/enums/MixLayoutMode.d.ts +18 -0
  41. package/dist/core/enums/MixVideoRenderMode.d.ts +14 -0
  42. package/dist/core/enums/RCBitrate.d.ts +48 -0
  43. package/dist/core/enums/RCCommandKind.d.ts +12 -0
  44. package/dist/core/enums/RCFrameRate.d.ts +7 -0
  45. package/dist/core/enums/RCInnerCDNBroadcast.d.ts +5 -0
  46. package/dist/core/enums/RCInnerCDNModel.d.ts +5 -0
  47. package/dist/core/enums/RCInnerCDNPullIsHttps.d.ts +5 -0
  48. package/dist/core/enums/RCInnerCDNPullKind.d.ts +6 -0
  49. package/dist/core/enums/RCInnerCDNPushMode.d.ts +5 -0
  50. package/dist/core/enums/RCKickType.d.ts +11 -0
  51. package/dist/core/enums/RCLinkedListPoint.d.ts +6 -0
  52. package/dist/core/enums/RCLivingType.d.ts +14 -0
  53. package/dist/core/enums/RCLoggerTag.d.ts +649 -0
  54. package/dist/core/enums/RCMediaType.d.ts +18 -0
  55. package/dist/core/enums/RCMixInputFilterMode.d.ts +35 -0
  56. package/dist/core/enums/RCRTCCode.d.ts +93 -0
  57. package/dist/core/enums/RCRTCLiveRole.d.ts +14 -0
  58. package/dist/core/enums/RCRTCPingResult.d.ts +5 -0
  59. package/dist/core/enums/RCRTCResolution.d.ts +132 -0
  60. package/dist/core/enums/RCResolution.d.ts +21 -0
  61. package/dist/core/enums/RTCJoinType.d.ts +18 -0
  62. package/dist/core/enums/RTCMode.d.ts +22 -0
  63. package/dist/core/enums/inner/LiveRole.d.ts +11 -0
  64. package/dist/core/enums/inner/LiveType.d.ts +14 -0
  65. package/dist/core/enums/inner/PolarisRole.d.ts +14 -0
  66. package/dist/core/enums/inner/R2Action.d.ts +14 -0
  67. package/dist/core/enums/inner/R2Status.d.ts +11 -0
  68. package/dist/core/enums/inner/RCRTCMessageType.d.ts +70 -0
  69. package/dist/core/enums/inner/RCStreamType.d.ts +14 -0
  70. package/dist/core/enums/inner/RTCApiType.d.ts +5 -0
  71. package/dist/core/enums/inner/RTCIdentityChangeType.d.ts +5 -0
  72. package/dist/core/enums/inner/TrackState.d.ts +14 -0
  73. package/dist/core/interfaces.d.ts +942 -0
  74. package/dist/core/room/Pinger.d.ts +36 -0
  75. package/dist/core/room/RCAbstractRoom.d.ts +354 -0
  76. package/dist/core/room/RCAudienceLivingRoom.d.ts +334 -0
  77. package/dist/core/room/RCAudioLevelReport.d.ts +16 -0
  78. package/dist/core/room/RCLivingPKHandler.d.ts +165 -0
  79. package/dist/core/room/RCLivingRoom.d.ts +112 -0
  80. package/dist/core/room/RCLocalMediaStream.d.ts +8 -0
  81. package/dist/core/room/RCMCUConfigBuilder.d.ts +211 -0
  82. package/dist/core/room/RCRTCRoom.d.ts +17 -0
  83. package/dist/core/service/RCMediaService.d.ts +121 -0
  84. package/dist/core/service/helper.d.ts +18 -0
  85. package/dist/core/service/index.d.ts +6 -0
  86. package/dist/core/service/interface.d.ts +328 -0
  87. package/dist/core/service/mcu-interface.d.ts +293 -0
  88. package/dist/core/tracks/RC3AnoiseTrack.d.ts +27 -0
  89. package/dist/core/tracks/RCLocalTrack.d.ts +143 -0
  90. package/dist/core/tracks/RCRemoteTrack.d.ts +29 -0
  91. package/dist/core/tracks/RCTrack.d.ts +95 -0
  92. package/dist/core/webrtc/RCRTCPeerCManager.d.ts +161 -0
  93. package/dist/core/webrtc/RCRTCPeerConnection.d.ts +112 -0
  94. package/dist/core/webrtc/helper.d.ts +26 -0
  95. package/dist/core/webrtc/sdp/ASdpBuilder.d.ts +120 -0
  96. package/dist/core/webrtc/sdp/ASdpStrategy.d.ts +53 -0
  97. package/dist/core/webrtc/sdp/PlanBSdpBuilder.d.ts +20 -0
  98. package/dist/core/webrtc/sdp/PlanBStrategy.d.ts +26 -0
  99. package/dist/core/webrtc/sdp/SDPUtils.d.ts +60 -0
  100. package/dist/core/webrtc/sdp/UnifiedPlanSdpBuilder.d.ts +11 -0
  101. package/dist/core/webrtc/sdp/UnifiedPlanStrategy.d.ts +25 -0
  102. package/dist/core/webrtc/stat-parser/AbstractStatParser.d.ts +117 -0
  103. package/dist/core/webrtc/stat-parser/ChromeStatParser.d.ts +14 -0
  104. package/dist/core/webrtc/stat-parser/FirefoxStatParser.d.ts +14 -0
  105. package/dist/core/webrtc/stat-parser/IStatParser.d.ts +24 -0
  106. package/dist/core/webrtc/stat-parser/SafariStatParser.d.ts +14 -0
  107. package/dist/device.d.ts +6 -0
  108. package/dist/helper.d.ts +195 -0
  109. package/dist/index.d.ts +9 -32
  110. package/dist/index.esm.js +15 -21642
  111. package/dist/index.js +15 -21671
  112. package/dist/index.umd.js +15 -21675
  113. package/dist/logger.d.ts +4 -0
  114. package/package.json +5 -2
@@ -0,0 +1,117 @@
1
+ import IStatParser from './IStatParser';
2
+ import { IInnerRCRTCStateReport } from '../../interfaces';
3
+ export default abstract class AbstractStatParser implements IStatParser {
4
+ protected readonly _rtcPeerConn: RTCPeerConnection;
5
+ protected readonly _sdpSemantics: string;
6
+ protected readonly _currentUserId: string;
7
+ constructor(_rtcPeerConn: RTCPeerConnection, _sdpSemantics: string, _currentUserId: string);
8
+ /**
9
+ * 最近的上行发送包数据统计
10
+ */
11
+ protected _latestPacketsSent: {
12
+ [resourceId: string]: {
13
+ packetsLost?: number;
14
+ packetsSent?: number;
15
+ crtPacketsSent?: number;
16
+ };
17
+ };
18
+ /**
19
+ * 最近的上行发送字节数统计
20
+ */
21
+ protected _latestBytesSent: {
22
+ [resourceId: string]: {
23
+ bytesSent: number;
24
+ timestamp: number;
25
+ };
26
+ };
27
+ /**
28
+ * 最近的下行接收字节数统计
29
+ */
30
+ protected _latestBytesRecv: {
31
+ [resourceId: string]: {
32
+ bytesRecv: number;
33
+ timestamp: number;
34
+ };
35
+ };
36
+ /**
37
+ * 最近的下行接收包数据统计
38
+ */
39
+ protected _latestPacketsRecv: {
40
+ [resourceId: string]: {
41
+ packetsLost: number;
42
+ packetsRecv: number;
43
+ };
44
+ };
45
+ /**
46
+ * 更新上行码率存储,返回计算出的码率
47
+ * @param resourceId
48
+ * @param bytesSent 本次发送的字节数
49
+ * @param timestamp
50
+ * @returns bitrate
51
+ */
52
+ protected updateBytesSent(resourceId: string, bytesSent: number, timestamp: number): number;
53
+ /**
54
+ * 更新下行码率存储,返回计算出的码率
55
+ * @param resourceId
56
+ * @param bytesRecv
57
+ * @param timestamp
58
+ * @returns bitrate
59
+ */
60
+ protected updateBytesRecv(resourceId: string, bytesRecv: number, timestamp: number): number;
61
+ /**
62
+ * 更新上行丢包总数,返回计算出的丢包率
63
+ * 计算丢包率
64
+ * 上行数据统计中,packageLost 的统计具有延时性
65
+ * 会导致瞬时的 packetsLost - prePacketsLost 值大于 packetsSent - prePacketsSent,从而丢包率可能大于 1
66
+ * 因此此处计算只在 packetsLost - prePacketsLost !== 0 时计算丢包率,其他时间丢包为 0
67
+ * packetsSent 只在 packetsLost 有变化时更新
68
+ */
69
+ protected updateSenderPacketsLost(resourceId: string, packetsLost: number, packetsSent: number): number;
70
+ /**
71
+ * 更新下行丢包总数,返回计算出的丢包率
72
+ */
73
+ protected updateReceiverPacketsLost(resourceId: string, packetsLost: number, packetsReceived: number): number;
74
+ /**
75
+ * 取消发布后,需把 _latestPacketsSent 中 key 为 resourceId 存储的数据清除掉
76
+ */
77
+ clearLatestpacketsSent(resourceIds: string[]): void;
78
+ /**
79
+ * 取消订阅后,需把 _latestPacketsRecv 中 key 为 resourceId 存储的数据清除掉
80
+ */
81
+ clearLatestPacketsRecv(resourceIds: string[]): void;
82
+ parseRTCStatsReport(reports: RTCStatsReport): {
83
+ [key: string]: any;
84
+ };
85
+ formatRCRTCStateReport(stats: {
86
+ [key: string]: any;
87
+ }): IInnerRCRTCStateReport;
88
+ getAudioLevelList(stats: {
89
+ [key: string]: any;
90
+ }): {
91
+ trackId: string;
92
+ audioLevel: number | null;
93
+ }[];
94
+ /**
95
+ * 从 offer 和 answer 的 sdp 中获取 ssrc 对应的 msid
96
+ * @param statInfo outbound 和 inbound 对应值
97
+ * @returns resourceId
98
+ */
99
+ protected getResourceIdByParseSdp(statInfo: {
100
+ [key: string]: any;
101
+ }): string;
102
+ /**
103
+ * 从 offer sdp 中查找 ssrc 对应的通道是否可用
104
+ * @param outboundInfo
105
+ */
106
+ protected isValidSender(outboundInfo: {
107
+ [key: string]: any;
108
+ }): boolean;
109
+ /**
110
+ * 从 answer sdp 中查找 ssrc 对应的通道是否可用
111
+ * @param inboundInfo
112
+ */
113
+ protected isValidReceiver(inboundInfo: {
114
+ [key: string]: any;
115
+ }): boolean;
116
+ }
117
+ //# sourceMappingURL=AbstractStatParser.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { IInnerRCRTCStateReport } from '../../interfaces';
2
+ import AbstractStatParser from './AbstractStatParser';
3
+ export default class RTCReportParser extends AbstractStatParser {
4
+ formatRCRTCStateReport(stats: {
5
+ [key: string]: any;
6
+ }): IInnerRCRTCStateReport;
7
+ getAudioLevelList(stats: {
8
+ [key: string]: any;
9
+ }): {
10
+ trackId: string;
11
+ audioLevel: number | null;
12
+ }[];
13
+ }
14
+ //# sourceMappingURL=ChromeStatParser.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { IInnerRCRTCStateReport } from '../../interfaces';
2
+ import AbstractStatParser from './AbstractStatParser';
3
+ export default class RTCReportParser extends AbstractStatParser {
4
+ formatRCRTCStateReport(stats: {
5
+ [key: string]: any;
6
+ }): IInnerRCRTCStateReport;
7
+ getAudioLevelList(stats: {
8
+ [key: string]: any;
9
+ }): {
10
+ trackId: string;
11
+ audioLevel: number | null;
12
+ }[];
13
+ }
14
+ //# sourceMappingURL=FirefoxStatParser.d.ts.map
@@ -0,0 +1,24 @@
1
+ import { IInnerRCRTCStateReport } from '../../interfaces';
2
+ export default interface IStatParser {
3
+ /**
4
+ * 取消发布后,需把 _latestPacketsSent 中 key 为 resourceId 存储的数据清除掉
5
+ */
6
+ clearLatestpacketsSent(resourceIds: string[]): void;
7
+ /**
8
+ * 取消订阅后,需把 _latestPacketsRecv 中 key 为 resourceId 存储的数据清除掉
9
+ */
10
+ clearLatestPacketsRecv(resourceIds: string[]): void;
11
+ parseRTCStatsReport(reports: RTCStatsReport): {
12
+ [key: string]: any;
13
+ };
14
+ formatRCRTCStateReport(stats: {
15
+ [key: string]: any;
16
+ }): IInnerRCRTCStateReport;
17
+ getAudioLevelList(stats: {
18
+ [key: string]: any;
19
+ }): {
20
+ trackId: string;
21
+ audioLevel: number | null;
22
+ }[];
23
+ }
24
+ //# sourceMappingURL=IStatParser.d.ts.map
@@ -0,0 +1,14 @@
1
+ import { IInnerRCRTCStateReport } from '../../interfaces';
2
+ import AbstractStatParser from './AbstractStatParser';
3
+ export default class RTCReportParser extends AbstractStatParser {
4
+ formatRCRTCStateReport(stats: {
5
+ [key: string]: any;
6
+ }): IInnerRCRTCStateReport;
7
+ getAudioLevelList(stats: {
8
+ [key: string]: any;
9
+ }): {
10
+ trackId: string;
11
+ audioLevel: number | null;
12
+ }[];
13
+ }
14
+ //# sourceMappingURL=SafariStatParser.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare const device: {
2
+ getCameras: () => Promise<MediaDeviceInfo[]>;
3
+ getMicrophones: () => Promise<MediaDeviceInfo[]>;
4
+ getSpeakers: () => Promise<MediaDeviceInfo[]>;
5
+ };
6
+ //# sourceMappingURL=device.d.ts.map
@@ -0,0 +1,195 @@
1
+ import { INaviInfo } from '@rongcloud/engine';
2
+ import { RCFrameRate } from './core/enums/RCFrameRate';
3
+ import { RCResolution } from './core/enums/RCResolution';
4
+ import { RCRTCMessageType } from './core/enums/inner/RCRTCMessageType';
5
+ import { IPKInfo, IPublishAttrs, IPublishedResource, IResource, ISubscribeAttr, RoomData } from './core/interfaces';
6
+ import { RCMediaType } from './core/enums/RCMediaType';
7
+ import { RCLocalTrack } from './core/tracks/RCLocalTrack';
8
+ import RCRTCPeerConnection from './core/webrtc/RCRTCPeerConnection';
9
+ import { RCRemoteTrack } from './core/tracks/RCRemoteTrack';
10
+ import { RCTrack } from './core/tracks/RCTrack';
11
+ import { IRTCUsers, IServerRTCRoomEntry } from './core/codec/interface';
12
+ /**
13
+ * 构建增量消息内容
14
+ * @param objectname 消息名
15
+ * @param uris 增量变更资源
16
+ */
17
+ export declare const buildPlusMessage: (messageName: RCRTCMessageType, uris: IPublishedResource[]) => {
18
+ name: RCRTCMessageType;
19
+ content: string;
20
+ };
21
+ /**
22
+ * 构建预发布的全量资源变更消息
23
+ * @param uris 全量资源数据
24
+ */
25
+ export declare const buildTotalURIMessageContent: (uris: IPublishedResource[]) => string;
26
+ /**
27
+ * roomId 有效性验证
28
+ * @param roomId
29
+ */
30
+ export declare const isValidRoomId: (roomId: string) => boolean;
31
+ /**
32
+ * 验证 tag 是否有效
33
+ * @param tag
34
+ * @returns
35
+ */
36
+ export declare const isValidTag: (tag: string) => boolean;
37
+ /**
38
+ * 页面地址有效性检测
39
+ */
40
+ export declare const isValidLocation: boolean;
41
+ /**
42
+ * 获取视频流的分辨率及帧率数据,若无法获取真实值,则返回 0
43
+ * @param track
44
+ */
45
+ export declare const getVideoTrackInfo: (track: MediaStreamTrack) => {
46
+ /**
47
+ * applyConstraints 方法应用的宽高约束不一定可以立马生效
48
+ * 取值优先 constraints
49
+ */
50
+ width: number;
51
+ height: number;
52
+ frameRate: number;
53
+ };
54
+ /**
55
+ * 取视频流动态码率
56
+ * @param track
57
+ * @returns
58
+ */
59
+ export declare const getDynamicBitrate: (track: MediaStreamTrack) => {
60
+ min: number;
61
+ max: number;
62
+ };
63
+ /**
64
+ * 获取资源唯一性标识
65
+ * @param item
66
+ */
67
+ export declare const getTrackId: (item: IResource) => string;
68
+ /**
69
+ * 它接受一个类似“userId_tag_mediaType”的字符串,并返回一个包含字符串三个部分的对象
70
+ * 解析 trackId 以获取资源信息
71
+ * trackId 构成说明 trackId = [ userid, tag, mediaType ].join('_')
72
+ * userid : 用户可随意定义可包含 _ 下划线
73
+ * tag : `不可以有 _ 下划线`
74
+ * mediaType : RCMediaType 0:音频流 1:视频流 2:音视频混合流
75
+ * @param {string} trackId - 远程轨道的轨道 ID。
76
+ * @returns 具有三个属性的对象:mediaType、tag 和 userId。
77
+ */
78
+ export declare const parseTrackId: (trackId: string) => {
79
+ mediaType: RCMediaType;
80
+ tag: string;
81
+ userId: string;
82
+ };
83
+ export declare const parseStreamId: (streamId: string) => {
84
+ tag: string;
85
+ userId: string;
86
+ };
87
+ export declare const formatStreamId: (userId: string, tag: string) => string;
88
+ export declare const deepCopyResources: <T>(resources: T[]) => T[];
89
+ /**
90
+ * 比对资源找出新增、状态变更及取消发布的资源
91
+ * @param prevResources 原资源数据
92
+ * @param resources 变更的全量资源
93
+ */
94
+ export declare const diffPublishResources: (prevResources: IPublishedResource[], resources: IPublishedResource[], isReconnect?: boolean) => {
95
+ publishedList: IPublishedResource[];
96
+ unpublishedList: IPublishedResource[];
97
+ modifiedList: IPublishedResource[];
98
+ };
99
+ export declare const diffPubResOnReconnect: (prevResources: IPublishedResource[], resources: IPublishedResource[]) => {
100
+ publishedList: IPublishedResource[];
101
+ unpublishedList: IPublishedResource[];
102
+ modifiedList: IPublishedResource[];
103
+ };
104
+ export declare const getUUID22: () => string;
105
+ /**
106
+ * 转化 RCResolution 枚举值为分辨率宽高
107
+ * @param resolution
108
+ * @returns
109
+ */
110
+ export declare const transResolution: (resolution: RCResolution) => {
111
+ width: number;
112
+ height: number;
113
+ };
114
+ /**
115
+ * 判断枚举值有效性
116
+ * @param resolution
117
+ * @returns
118
+ */
119
+ export declare const isValidResolution: (resolution?: RCResolution) => boolean;
120
+ /**
121
+ * 判断帧率枚举值有效性
122
+ * @param fps
123
+ * @returns
124
+ */
125
+ export declare const isValidFPS: (fps?: RCFrameRate) => boolean;
126
+ /**
127
+ * 获取枚举值对应的帧率
128
+ * @param fps
129
+ * @returns
130
+ */
131
+ export declare const transFrameRate: (fps: RCFrameRate) => number;
132
+ export declare type IBrowserDetails = {
133
+ browser: string;
134
+ version?: number;
135
+ supportsUnifiedPlan: boolean;
136
+ };
137
+ export declare const browserInfo: IBrowserDetails;
138
+ /**
139
+ * 验证浏览器是否支持创建自定义文件流
140
+ * @returns
141
+ */
142
+ export declare function ifSupportLocalFileTrack(): boolean;
143
+ /**
144
+ * 验证浏览器是否支持屏幕共享
145
+ * @returns
146
+ */
147
+ export declare function ifSupportScreenShare(): boolean;
148
+ /**
149
+ * 检查参数是否为 null
150
+ */
151
+ export declare const isNull: (val: any) => boolean;
152
+ /**
153
+ * 公有云连接私有云 SDK 为非法连接
154
+ */
155
+ export declare const isIllegalConnection: (navi: INaviInfo) => boolean;
156
+ /**
157
+ * 获取将要发布的 track 数量
158
+ * 需要发布小流的算两个 track
159
+ */
160
+ export declare const calcTracksNum: (tracks: (RCLocalTrack | IPublishAttrs)[], pc: RCRTCPeerConnection) => number;
161
+ /**
162
+ * 解析房间数据
163
+ */
164
+ export declare const parseRoomData: (data: IRTCUsers, mainRoomId: string) => RoomData;
165
+ export declare const isRepeatPub: (newPub: IPublishedResource, allPublishList: IPublishedResource[]) => {
166
+ isInclude: boolean;
167
+ index: number;
168
+ };
169
+ /**
170
+ * 从加房间返回的数据中获取加入的副房间
171
+ */
172
+ export declare const getPKInfoByRoomData: (mainRoomId: string, roomInfo: {
173
+ key: string;
174
+ value: string;
175
+ }[]) => IPKInfo;
176
+ /**
177
+ * 解析观众加房间 kv 数据
178
+ * 远端无人员时,kvEntries 的 key 不包含 RC_ANCHOR_LIST
179
+ * 远端无资源时,key 不包含 RC_RES_、RC_CDN
180
+ * 远端有资源、无 CDN 资源时,key 不包含 RC_CDN
181
+ * 服务端 bug,偶现无 RC_RTC_SESSIONID
182
+ */
183
+ export declare const parseAudienceRoomData: (roomId: string, kvEntries: IServerRTCRoomEntry[]) => {
184
+ sessionId: string;
185
+ remoteUserIds: string[];
186
+ remoteRTCUris: IPublishedResource[];
187
+ remoteMUCUris: IPublishedResource[];
188
+ remoteRTCTracks: RCRemoteTrack[];
189
+ remoteMCUTracks: RCRemoteTrack[];
190
+ remoteTracks: RCRemoteTrack[];
191
+ CDNUris: any;
192
+ };
193
+ export declare const getTrackIdFromAttr: (track: RCTrack | ISubscribeAttr | IPublishAttrs) => string;
194
+ export declare const int64ToTimestamp: (obj: any) => number;
195
+ //# sourceMappingURL=helper.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCRTC - v5.5.4-alpha.1
3
- * CommitId - 5979242633209b9a8830d449c1d7a425a1868f7b
4
- * Fri Sep 30 2022 20:48:58 GMT+0800 (China Standard Time)
2
+ * RCRTC - v5.5.4
3
+ * CommitId - 80b0c1d49cb6cbe32c4b66a016063568d6893014
4
+ * Sun Oct 09 2022 17:26:05 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  import * as _rongcloud_engine from '@rongcloud/engine';
@@ -646,19 +646,7 @@ declare enum RTCMode {
646
646
  /**
647
647
  * 跨应用直播
648
648
  */
649
- CROSS_LIVE = 8,
650
- /**
651
- * sip呼叫
652
- */
653
- SIP = 4,
654
- /**
655
- * 呼叫模式.包括单呼和群呼
656
- */
657
- CALL = 5,
658
- /**
659
- * 会议
660
- */
661
- MEETING = 6
649
+ CROSS_LIVE = 8
662
650
  }
663
651
 
664
652
  /**
@@ -1278,7 +1266,6 @@ declare const keymaps: {
1278
1266
  readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
1279
1267
  readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
1280
1268
  readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
1281
- readonly RtcReportSDKInput: readonly ["sdkInfo"];
1282
1269
  };
1283
1270
  declare type RTCKeyMaps = typeof keymaps;
1284
1271
 
@@ -1499,7 +1486,7 @@ declare class RTCContext {
1499
1486
  getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
1500
1487
  pullRTCRoomEntry(roomId: string): Promise<IAsyncRes<IChrmKVPullData>>;
1501
1488
  decodeRtcNotify(buffer: Uint8Array): {
1502
- time: number;
1489
+ time: any;
1503
1490
  type: any;
1504
1491
  roomId: any;
1505
1492
  };
@@ -1516,9 +1503,6 @@ declare class RTCContext {
1516
1503
  registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
1517
1504
  getCoreVersion(): string;
1518
1505
  getPluginContext(): RTCPluginContext;
1519
- reportSDKInfo(versionInfo: {
1520
- [name: string]: string;
1521
- }): void;
1522
1506
  }
1523
1507
 
1524
1508
  declare class RCMediaService {
@@ -2878,8 +2862,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
2878
2862
  private _reportStatsTimer;
2879
2863
  private _reportR3R4ToPolarisTimer;
2880
2864
  private _isDestroyed;
2881
- private _reportStatsData?;
2882
- private _originReportStatsData?;
2883
2865
  constructor(
2884
2866
  /**
2885
2867
  * peerConnection 对应名称
@@ -2900,8 +2882,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
2900
2882
  getName(): string;
2901
2883
  getLocalTracks(): RCLocalTrack[];
2902
2884
  private _onConnectionStateChange;
2903
- private startAutoExecute;
2904
- private stopAutoExecute;
2905
2885
  private _onICEConnectionStateChange;
2906
2886
  private _onTrackReady;
2907
2887
  /**
@@ -2936,7 +2916,7 @@ declare class RCRTCPeerConnection extends EventEmitter {
2936
2916
  * @returns 返回格式化后的数据
2937
2917
  */
2938
2918
  private _getStatsData;
2939
- getAudioLevelReportData(gap?: number): Promise<{
2919
+ getAudioLevelReportData(): Promise<{
2940
2920
  trackId: string;
2941
2921
  audioLevel: number | null;
2942
2922
  }[] | undefined>;
@@ -2945,10 +2925,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
2945
2925
  * @todo
2946
2926
  */
2947
2927
  private _reportHandle;
2948
- /**
2949
- * 获取缓存的本地质量数据
2950
- */
2951
- _getCacheStatsData(): IInnerRCRTCStateReport | null | undefined;
2952
2928
  /**
2953
2929
  * 北极星上报 R3、R4 数据
2954
2930
  */
@@ -2998,8 +2974,10 @@ interface IResource {
2998
2974
  uri: string;
2999
2975
  /**
3000
2976
  * 资源特征,simulcast 代表这道流支持大小流
2977
+ * @description 此参数存疑,MediaServer 似乎并未下发此字段,Web 端暂不启用
2978
+ * @deprecated
3001
2979
  */
3002
- simulcast: number;
2980
+ features?: ['simulcast'] | [];
3003
2981
  }
3004
2982
  /**
3005
2983
  * 向房间内发布的媒体数据
@@ -4228,7 +4206,6 @@ declare class RCRTCClient extends RCMediaStreamCapture {
4228
4206
  code: RCRTCCode | ErrorCode;
4229
4207
  data?: IRTCJoinedInfo[];
4230
4208
  }>;
4231
- reportSDKInfo(): void;
4232
4209
  }
4233
4210
 
4234
4211
  /**