@rongcloud/plugin-rtc 5.1.10-alpha.3 → 5.1.10-enterprise.2
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 +353 -118
- package/dist/index.esm.js +519 -188
- package/dist/index.js +517 -189
- package/dist/index.umd.js +517 -189
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,66 +1,10 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.1.10-
|
|
3
|
-
* CommitId -
|
|
4
|
-
* Thu
|
|
2
|
+
* RCRTC - v5.1.10-enterprise.2
|
|
3
|
+
* CommitId - 5b9b0aef08a0933ff4adc82569d6903422b7a232
|
|
4
|
+
* Thu Jun 23 2022 21:44:53 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
|
-
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, KVString, ErrorCode,
|
|
8
|
-
export { RTCJoinType } from '@rongcloud/engine';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 媒体资源类型
|
|
12
|
-
*/
|
|
13
|
-
declare enum RCMediaType {
|
|
14
|
-
/**
|
|
15
|
-
* 音频流
|
|
16
|
-
*/
|
|
17
|
-
AUDIO_ONLY = 0,
|
|
18
|
-
/**
|
|
19
|
-
* 视频流
|
|
20
|
-
*/
|
|
21
|
-
VIDEO_ONLY = 1,
|
|
22
|
-
/**
|
|
23
|
-
* 音视频混合流,只在 web 端存在混合流的情况
|
|
24
|
-
*/
|
|
25
|
-
AUDIO_VIDEO = 2
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
declare enum RCFrameRate {
|
|
29
|
-
FPS_10 = "FPS_10",
|
|
30
|
-
FPS_15 = "FPS_15",
|
|
31
|
-
FPS_24 = "FPS_24",
|
|
32
|
-
FPS_30 = "FPS_30"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
declare enum RCResolution {
|
|
36
|
-
W176_H132 = "W176_H132",
|
|
37
|
-
W176_H144 = "W176_H144",
|
|
38
|
-
W256_H144 = "W256_H144",
|
|
39
|
-
W320_H180 = "W320_H180",
|
|
40
|
-
W240_H240 = "W240_H240",
|
|
41
|
-
W320_H240 = "W320_H240",
|
|
42
|
-
W480_H360 = "W480_H360",
|
|
43
|
-
W640_H360 = "W640_H360",
|
|
44
|
-
W480_H480 = "W480_H480",
|
|
45
|
-
W640_H480 = "W640_H480",
|
|
46
|
-
W720_H480 = "W720_H480",
|
|
47
|
-
W1280_H720 = "W1280_H720",
|
|
48
|
-
W1920_H1080 = "W1920_H1080"
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 流状态
|
|
53
|
-
*/
|
|
54
|
-
declare enum TrackState {
|
|
55
|
-
/**
|
|
56
|
-
* 不可用
|
|
57
|
-
*/
|
|
58
|
-
DISABLE = 0,
|
|
59
|
-
/**
|
|
60
|
-
* 可用
|
|
61
|
-
*/
|
|
62
|
-
ENABLE = 1
|
|
63
|
-
}
|
|
7
|
+
import { EventEmitter, LogLevel, RTCMode, IRuntime, RTCPluginContext, IServerRTCRoomEntry, IJoinRTCRoomData, IReceivedMessage, KVString, ErrorCode, IPluginGenerator } from '@rongcloud/engine';
|
|
64
8
|
|
|
65
9
|
/**
|
|
66
10
|
* 错误码,与移动端对齐
|
|
@@ -134,8 +78,77 @@ declare enum RCRTCCode {
|
|
|
134
78
|
PACKAGE_ENVIRONMENT_ERROR = 53025,
|
|
135
79
|
/** 单个用户发布资源超过限制 ( MediaServer 限制最多 10 个 track ) */
|
|
136
80
|
PUBLISH_TRACK_LIMIT_EXCEEDED = 53026,
|
|
137
|
-
/**
|
|
138
|
-
|
|
81
|
+
/** 房间内无主播推 CDN */
|
|
82
|
+
CDN_RESOURCE_IS_EMPTY = 53027
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* 媒体资源类型
|
|
87
|
+
*/
|
|
88
|
+
declare enum RCMediaType {
|
|
89
|
+
/**
|
|
90
|
+
* 音频流
|
|
91
|
+
*/
|
|
92
|
+
AUDIO_ONLY = 0,
|
|
93
|
+
/**
|
|
94
|
+
* 视频流
|
|
95
|
+
*/
|
|
96
|
+
VIDEO_ONLY = 1,
|
|
97
|
+
/**
|
|
98
|
+
* 音视频混合流,只在 web 端存在混合流的情况
|
|
99
|
+
*/
|
|
100
|
+
AUDIO_VIDEO = 2
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 资源大小流标识枚举
|
|
105
|
+
*/
|
|
106
|
+
declare enum RCStreamType {
|
|
107
|
+
/**
|
|
108
|
+
* 普通流(大流)
|
|
109
|
+
*/
|
|
110
|
+
NORMAL = 1,
|
|
111
|
+
/**
|
|
112
|
+
* 小流
|
|
113
|
+
*/
|
|
114
|
+
TINY = 2
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
declare enum RCFrameRate {
|
|
118
|
+
FPS_10 = "FPS_10",
|
|
119
|
+
FPS_15 = "FPS_15",
|
|
120
|
+
FPS_24 = "FPS_24",
|
|
121
|
+
FPS_30 = "FPS_30"
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare enum RCResolution {
|
|
125
|
+
W176_H132 = "W176_H132",
|
|
126
|
+
W176_H144 = "W176_H144",
|
|
127
|
+
W256_H144 = "W256_H144",
|
|
128
|
+
W320_H180 = "W320_H180",
|
|
129
|
+
W240_H240 = "W240_H240",
|
|
130
|
+
W320_H240 = "W320_H240",
|
|
131
|
+
W480_H360 = "W480_H360",
|
|
132
|
+
W640_H360 = "W640_H360",
|
|
133
|
+
W480_H480 = "W480_H480",
|
|
134
|
+
W640_H480 = "W640_H480",
|
|
135
|
+
W720_H480 = "W720_H480",
|
|
136
|
+
W1280_H720 = "W1280_H720",
|
|
137
|
+
W1920_H1080 = "W1920_H1080"
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* 流状态
|
|
142
|
+
*/
|
|
143
|
+
declare enum TrackState {
|
|
144
|
+
/**
|
|
145
|
+
* 不可用
|
|
146
|
+
*/
|
|
147
|
+
DISABLE = 0,
|
|
148
|
+
/**
|
|
149
|
+
* 可用
|
|
150
|
+
*/
|
|
151
|
+
ENABLE = 1
|
|
139
152
|
}
|
|
140
153
|
|
|
141
154
|
declare abstract class RCTrack extends EventEmitter {
|
|
@@ -342,20 +355,6 @@ declare class RCRemoteVideoTrack extends RCRemoteTrack {
|
|
|
342
355
|
constructor(tag: string, userId: string, roomId?: string);
|
|
343
356
|
}
|
|
344
357
|
|
|
345
|
-
/**
|
|
346
|
-
* 资源大小流标识枚举
|
|
347
|
-
*/
|
|
348
|
-
declare enum RCStreamType {
|
|
349
|
-
/**
|
|
350
|
-
* 普通流(大流)
|
|
351
|
-
*/
|
|
352
|
-
NORMAL = 1,
|
|
353
|
-
/**
|
|
354
|
-
* 小流
|
|
355
|
-
*/
|
|
356
|
-
TINY = 2
|
|
357
|
-
}
|
|
358
|
-
|
|
359
358
|
interface IStatParser {
|
|
360
359
|
/**
|
|
361
360
|
* 取消发布后,需把 _latestPacketsSent 中 key 为 resourceId 存储的数据清除掉
|
|
@@ -391,20 +390,15 @@ declare type OutboundVideoInfo = {
|
|
|
391
390
|
resolution: string;
|
|
392
391
|
};
|
|
393
392
|
|
|
394
|
-
declare enum
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
SERVER_KICK = 1,
|
|
399
|
-
/**
|
|
400
|
-
* 其他设备登陆后,本端被踢
|
|
401
|
-
*/
|
|
402
|
-
OTHER_KICK = 2
|
|
393
|
+
declare enum RCInnerCDNPullKind {
|
|
394
|
+
RTMP = "rtmp",
|
|
395
|
+
FLV = "flv",
|
|
396
|
+
HLS = "hls"
|
|
403
397
|
}
|
|
404
398
|
|
|
405
|
-
declare enum
|
|
406
|
-
|
|
407
|
-
|
|
399
|
+
declare enum RCInnerCDNPullIsHttps {
|
|
400
|
+
NOT_HTTPS = 0,
|
|
401
|
+
HTTPS = 1
|
|
408
402
|
}
|
|
409
403
|
|
|
410
404
|
interface IRCTrackBitrate {
|
|
@@ -712,7 +706,7 @@ interface IRCRTCReportListener {
|
|
|
712
706
|
onStateReport?(report: IRCRTCStateReport): void;
|
|
713
707
|
/**
|
|
714
708
|
* ~ICE 连接状态变更通知~
|
|
715
|
-
* @
|
|
709
|
+
* @deprecated
|
|
716
710
|
*/
|
|
717
711
|
onICEConnectionStateChange?(state: RTCIceConnectionState): void;
|
|
718
712
|
/**
|
|
@@ -740,7 +734,7 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
740
734
|
* 另一种可能是己方 rtcPing 失败次数超出上限
|
|
741
735
|
* @param byServer 当值为 `false` 时,说明本端 rtcPing 超时;当值为 `true` 时,说明本端收到被踢出房间通知
|
|
742
736
|
*/
|
|
743
|
-
onKickOff?(byServer: boolean
|
|
737
|
+
onKickOff?(byServer: boolean): void;
|
|
744
738
|
/**
|
|
745
739
|
* 接收到房间信令时回调,用户可通过房间实例的 sendMessage 接口发送信令
|
|
746
740
|
* @param name 信令名
|
|
@@ -787,10 +781,9 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
787
781
|
*/
|
|
788
782
|
onUserLeave?(userIds: string[]): void;
|
|
789
783
|
/**
|
|
790
|
-
*
|
|
791
|
-
* @since version: 5.1.5
|
|
784
|
+
* 主播开启、停止推 CDN 状态通知
|
|
792
785
|
*/
|
|
793
|
-
|
|
786
|
+
onCDNEnableChange?(enable: boolean): void;
|
|
794
787
|
}
|
|
795
788
|
/**
|
|
796
789
|
* RTCClient 初始化配置
|
|
@@ -830,6 +823,14 @@ interface IRCRTCInitOptions {
|
|
|
830
823
|
* 优化使用的 SDP 协议版本,仅当运行时浏览器支持相应 SDP 协议版本时生效
|
|
831
824
|
*/
|
|
832
825
|
sdpSemantics?: ISdpSemantics;
|
|
826
|
+
/**
|
|
827
|
+
* 观众拉内置 CDN 资源的直播拉流协议,默认为 RCInnerCDNPullKind.FLV
|
|
828
|
+
*/
|
|
829
|
+
pullInnerCDNProtocol?: RCInnerCDNPullKind;
|
|
830
|
+
/**
|
|
831
|
+
* 观众拉内置 CDN 资源时是否使用 https,默认为 RCInnerCDNPullIsHttps.HTTPS
|
|
832
|
+
*/
|
|
833
|
+
pullInnerCDNUseHttps?: RCInnerCDNPullIsHttps;
|
|
833
834
|
}
|
|
834
835
|
interface ICameraVideoProfile extends IVideoProfile {
|
|
835
836
|
cameraId?: string;
|
|
@@ -849,12 +850,31 @@ interface ICreateLocalTrackOptions {
|
|
|
849
850
|
*/
|
|
850
851
|
withoutVideo?: boolean;
|
|
851
852
|
}
|
|
853
|
+
/**
|
|
854
|
+
* 音量上报事件接口
|
|
855
|
+
*/
|
|
852
856
|
interface IAudioLevelChangeHandler {
|
|
853
857
|
(audioLevelReportList: {
|
|
854
858
|
track: RCLocalAudioTrack | RCRemoteAudioTrack;
|
|
855
859
|
audioLevel: number;
|
|
856
860
|
}[]): void;
|
|
857
861
|
}
|
|
862
|
+
/**
|
|
863
|
+
* 房间资源数据
|
|
864
|
+
*/
|
|
865
|
+
declare type RoomData = {
|
|
866
|
+
[userId: string]: IPublishedResource[];
|
|
867
|
+
};
|
|
868
|
+
|
|
869
|
+
declare enum RCInnerCDNPushMode {
|
|
870
|
+
AUTOMATIC = 0,
|
|
871
|
+
MANUAL = 1
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
declare enum RCInnerCDNBroadcast {
|
|
875
|
+
SPREAD = 0,
|
|
876
|
+
NO_SPREAD = -1
|
|
877
|
+
}
|
|
858
878
|
|
|
859
879
|
/**
|
|
860
880
|
* 与 MediaServer 交互所需的 Request Header 信息
|
|
@@ -954,6 +974,10 @@ interface ILiveUrls {
|
|
|
954
974
|
* 观众端订阅地址,由业务层分发
|
|
955
975
|
*/
|
|
956
976
|
liveUrl: string;
|
|
977
|
+
/**
|
|
978
|
+
* 自动推 CDN 模式下,发布资源后返回的 CDN 信息
|
|
979
|
+
*/
|
|
980
|
+
pull_url?: string;
|
|
957
981
|
}
|
|
958
982
|
interface IRTCResponse {
|
|
959
983
|
/**
|
|
@@ -1007,6 +1031,15 @@ interface IExchangeResponse extends IRTCResponse {
|
|
|
1007
1031
|
* 主播发布为具体资源,会议模式为空数组
|
|
1008
1032
|
*/
|
|
1009
1033
|
mcuPublishList?: IResource[];
|
|
1034
|
+
/**
|
|
1035
|
+
* 订阅成功的资源
|
|
1036
|
+
*/
|
|
1037
|
+
subscribedList?: {
|
|
1038
|
+
mediaType: RCMediaType.AUDIO_ONLY | RCMediaType.VIDEO_ONLY;
|
|
1039
|
+
msid: string;
|
|
1040
|
+
userId: string;
|
|
1041
|
+
simulcast?: RCStreamType;
|
|
1042
|
+
}[];
|
|
1010
1043
|
}
|
|
1011
1044
|
interface IBroadcastSubReqBody {
|
|
1012
1045
|
/**
|
|
@@ -1067,6 +1100,56 @@ interface IBroadcastSubRespBody extends IRTCResponse {
|
|
|
1067
1100
|
sdp: string;
|
|
1068
1101
|
};
|
|
1069
1102
|
}
|
|
1103
|
+
/**
|
|
1104
|
+
* 获取 CDN 资源拉流地址请求 headers
|
|
1105
|
+
*/
|
|
1106
|
+
interface ICDNPlayUrlReqHeaders extends IMCUReqHeaders {
|
|
1107
|
+
}
|
|
1108
|
+
/**
|
|
1109
|
+
* 获取 CDN 资源拉流地址响应
|
|
1110
|
+
*/
|
|
1111
|
+
interface ICDNPlayUrlResponse extends IRTCResponse {
|
|
1112
|
+
data: {
|
|
1113
|
+
fps: number;
|
|
1114
|
+
h: number;
|
|
1115
|
+
'pull_url': string;
|
|
1116
|
+
w: number;
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
/**
|
|
1120
|
+
* cdn_uris 里面包含的字段
|
|
1121
|
+
*/
|
|
1122
|
+
interface ICDNUris {
|
|
1123
|
+
/**
|
|
1124
|
+
* 是否扩散
|
|
1125
|
+
*/
|
|
1126
|
+
broadcast: RCInnerCDNBroadcast;
|
|
1127
|
+
/**
|
|
1128
|
+
* 拉流资源的宽度
|
|
1129
|
+
*/
|
|
1130
|
+
w?: number;
|
|
1131
|
+
/**
|
|
1132
|
+
* 拉流资源的高度
|
|
1133
|
+
*/
|
|
1134
|
+
h?: number;
|
|
1135
|
+
/**
|
|
1136
|
+
* 帧率
|
|
1137
|
+
*/
|
|
1138
|
+
fps?: number;
|
|
1139
|
+
/**
|
|
1140
|
+
* 获取拉流地址的 url
|
|
1141
|
+
*/
|
|
1142
|
+
url: string;
|
|
1143
|
+
/**
|
|
1144
|
+
* 开启、停用 CDN
|
|
1145
|
+
*/
|
|
1146
|
+
enableInnerCDN?: boolean;
|
|
1147
|
+
/**
|
|
1148
|
+
* 推送模式,手动 or 自动
|
|
1149
|
+
*/
|
|
1150
|
+
'push_mode': RCInnerCDNPushMode;
|
|
1151
|
+
'pull_safe': boolean;
|
|
1152
|
+
}
|
|
1070
1153
|
|
|
1071
1154
|
/**
|
|
1072
1155
|
* 直播布局模式定义
|
|
@@ -1100,6 +1183,11 @@ declare enum MixVideoRenderMode {
|
|
|
1100
1183
|
WHOLE = 2
|
|
1101
1184
|
}
|
|
1102
1185
|
|
|
1186
|
+
declare enum RCInnerCDNModel {
|
|
1187
|
+
OPEN = 1,
|
|
1188
|
+
STOP = 2
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1103
1191
|
/**
|
|
1104
1192
|
* 合流后的 video 输出编码配置,包含分辨率、帧率、码率配置项
|
|
1105
1193
|
*/
|
|
@@ -1347,6 +1435,18 @@ interface IMCUConfig {
|
|
|
1347
1435
|
*/
|
|
1348
1436
|
waterMark?: IMCUWaterMarkConfig;
|
|
1349
1437
|
}
|
|
1438
|
+
/**
|
|
1439
|
+
* 设置开启、停用内置 CDN 数据
|
|
1440
|
+
*/
|
|
1441
|
+
interface ISetEnableCDN {
|
|
1442
|
+
version: 2;
|
|
1443
|
+
output: {
|
|
1444
|
+
/**
|
|
1445
|
+
* 手动开启/停用内置 CDN
|
|
1446
|
+
*/
|
|
1447
|
+
inCDNModel: RCInnerCDNModel;
|
|
1448
|
+
};
|
|
1449
|
+
}
|
|
1350
1450
|
|
|
1351
1451
|
declare class RCMediaService {
|
|
1352
1452
|
private readonly _runtime;
|
|
@@ -1427,8 +1527,16 @@ declare class RCMediaService {
|
|
|
1427
1527
|
/**
|
|
1428
1528
|
* 直播推流、自定义布局配置
|
|
1429
1529
|
*/
|
|
1430
|
-
setMcuConfig(headers: IMCUReqHeaders, body: IMCUConfig): Promise<{
|
|
1530
|
+
setMcuConfig(headers: IMCUReqHeaders, body: IMCUConfig | ISetEnableCDN): Promise<{
|
|
1531
|
+
code: RCRTCCode;
|
|
1532
|
+
res?: any;
|
|
1533
|
+
}>;
|
|
1534
|
+
/**
|
|
1535
|
+
* 房间内观众获取 CDN 资源信息、拉流地址
|
|
1536
|
+
*/
|
|
1537
|
+
getCDNResourceInfo(headers: ICDNPlayUrlReqHeaders, url: string): Promise<{
|
|
1431
1538
|
code: RCRTCCode;
|
|
1539
|
+
res?: ICDNPlayUrlResponse;
|
|
1432
1540
|
}>;
|
|
1433
1541
|
}
|
|
1434
1542
|
|
|
@@ -1500,6 +1608,24 @@ interface IAudienceRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
1500
1608
|
* @param videoTrack RCRemoteVideoTrack 类实例对象
|
|
1501
1609
|
*/
|
|
1502
1610
|
onVideoMuteChange?(videoTrack: RCRemoteVideoTrack): void;
|
|
1611
|
+
/**
|
|
1612
|
+
* 房间内主播把发布的资源推至 CDN
|
|
1613
|
+
*/
|
|
1614
|
+
onCDNInfoEnable?(CDNInfo: {
|
|
1615
|
+
resolution: RCResolution;
|
|
1616
|
+
fps: RCFrameRate;
|
|
1617
|
+
}): void;
|
|
1618
|
+
/**
|
|
1619
|
+
* 主播停止推 CDN
|
|
1620
|
+
*/
|
|
1621
|
+
onCDNInfoDisable?(): void;
|
|
1622
|
+
/**
|
|
1623
|
+
* 主播改变推 CDN 的分辨率或帧率
|
|
1624
|
+
*/
|
|
1625
|
+
onCDNInfoChange?(CDNInfo: {
|
|
1626
|
+
resolution: RCResolution;
|
|
1627
|
+
fps: RCFrameRate;
|
|
1628
|
+
}): void;
|
|
1503
1629
|
}
|
|
1504
1630
|
/**
|
|
1505
1631
|
* 观众直播房间类
|
|
@@ -1512,7 +1638,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1512
1638
|
private readonly _runtime;
|
|
1513
1639
|
private readonly _initOptions;
|
|
1514
1640
|
readonly _roomId: string;
|
|
1515
|
-
private readonly
|
|
1641
|
+
private readonly _joinResData;
|
|
1516
1642
|
readonly _livingType: RCLivingType;
|
|
1517
1643
|
private readonly _service;
|
|
1518
1644
|
private _roomAnchorList;
|
|
@@ -1532,7 +1658,14 @@ declare class RCAudienceLivingRoom {
|
|
|
1532
1658
|
* 音量上报实例
|
|
1533
1659
|
*/
|
|
1534
1660
|
private _audioLevelReport;
|
|
1535
|
-
|
|
1661
|
+
/**
|
|
1662
|
+
* cdn_uris 资源
|
|
1663
|
+
*/
|
|
1664
|
+
private _CDNUris;
|
|
1665
|
+
constructor(_context: RTCPluginContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
|
|
1666
|
+
token: string;
|
|
1667
|
+
kvEntries?: IServerRTCRoomEntry[];
|
|
1668
|
+
}, _livingType: RCLivingType);
|
|
1536
1669
|
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
1537
1670
|
/**
|
|
1538
1671
|
* @description 信令数据处理
|
|
@@ -1541,6 +1674,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1541
1674
|
* * key RC_ANCHOR_LIST value: 为主播 ID 集合
|
|
1542
1675
|
* * key RC_RES_`userId` value: 为主播发布的资源
|
|
1543
1676
|
* * key RC_RTC_SESSIONID value: sessionId
|
|
1677
|
+
* * key RC_CDN value: CDN 资源数据
|
|
1544
1678
|
*/
|
|
1545
1679
|
private singalDataChange;
|
|
1546
1680
|
/**
|
|
@@ -1583,12 +1717,33 @@ declare class RCAudienceLivingRoom {
|
|
|
1583
1717
|
private _getReqHeaders;
|
|
1584
1718
|
private _exchangeHandle;
|
|
1585
1719
|
private _updateSubListHandle;
|
|
1720
|
+
/**
|
|
1721
|
+
* 对比 cdn_uris 资源
|
|
1722
|
+
* @param newCDNUris 新的 cdn_uris 数据
|
|
1723
|
+
*/
|
|
1724
|
+
private _diffCDNUris;
|
|
1725
|
+
/**
|
|
1726
|
+
* 获取 CDN 资源对应的拉流地址
|
|
1727
|
+
* 首次获取 CDNPlayUrl 时,需传入 url,
|
|
1728
|
+
* 业务层调用时使用内存中 _CDNUris 的 url,无 _CDNUris 时说明观众端未赋值过 _CDNUris
|
|
1729
|
+
* @returns CDNPlayUrl
|
|
1730
|
+
*/
|
|
1731
|
+
private _getCDNPlayUrl;
|
|
1732
|
+
/**
|
|
1733
|
+
* 获取 CDN 资源对应的拉流地址
|
|
1734
|
+
* @returns CDNPlayUrl
|
|
1735
|
+
*/
|
|
1736
|
+
getCDNPlayUrl(resolution?: RCResolution, fps?: RCFrameRate): Promise<{
|
|
1737
|
+
code: RCRTCCode;
|
|
1738
|
+
CDNPlayUrl?: string;
|
|
1739
|
+
}>;
|
|
1586
1740
|
/**
|
|
1587
1741
|
* 订阅资源
|
|
1588
1742
|
* @param tracks
|
|
1589
1743
|
*/
|
|
1590
1744
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
1591
1745
|
code: RCRTCCode;
|
|
1746
|
+
failedList?: ISubscribeAttr[];
|
|
1592
1747
|
}>;
|
|
1593
1748
|
private __unsubscribe;
|
|
1594
1749
|
/**
|
|
@@ -1597,6 +1752,7 @@ declare class RCAudienceLivingRoom {
|
|
|
1597
1752
|
*/
|
|
1598
1753
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
1599
1754
|
code: RCRTCCode;
|
|
1755
|
+
failedList?: ISubscribeAttr[];
|
|
1600
1756
|
}>;
|
|
1601
1757
|
/**
|
|
1602
1758
|
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
@@ -1783,9 +1939,6 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
1783
1939
|
clearReTryExchangeTimer(): void;
|
|
1784
1940
|
}
|
|
1785
1941
|
|
|
1786
|
-
declare type RoomData = {
|
|
1787
|
-
[userId: string]: IPublishedResource[];
|
|
1788
|
-
};
|
|
1789
1942
|
/**
|
|
1790
1943
|
* 房间抽象基类
|
|
1791
1944
|
*/
|
|
@@ -1836,7 +1989,6 @@ declare abstract class RCAbstractRoom {
|
|
|
1836
1989
|
private _audioLevelReport;
|
|
1837
1990
|
constructor(_context: RTCPluginContext, _runtime: IRuntime, _roomId: string, data: IJoinRTCRoomData, _roomMode: RTCMode, _service: RCMediaService, _initOptions: IRCRTCInitOptions, _ntfClearRoomItem: Function, isUpgrade?: boolean);
|
|
1838
1991
|
private _initRemoteTracks;
|
|
1839
|
-
private _handlePingResult;
|
|
1840
1992
|
/**
|
|
1841
1993
|
* 设置房间上行资源的总码率配置
|
|
1842
1994
|
* @description
|
|
@@ -1848,7 +2000,7 @@ declare abstract class RCAbstractRoom {
|
|
|
1848
2000
|
*/
|
|
1849
2001
|
setBitrate(max: number, min: number, start?: number): void;
|
|
1850
2002
|
private _onTrackReady;
|
|
1851
|
-
|
|
2003
|
+
protected _callAppListener(eventType: keyof IRoomEventListener, ...attrs: any[]): void;
|
|
1852
2004
|
private _onUserUnpublish;
|
|
1853
2005
|
private _onTrackUnpublish;
|
|
1854
2006
|
private _unpublishPrev;
|
|
@@ -1868,7 +2020,18 @@ declare abstract class RCAbstractRoom {
|
|
|
1868
2020
|
* @param messageType 消息类型
|
|
1869
2021
|
* @param userId 消息发送者
|
|
1870
2022
|
*/
|
|
1871
|
-
|
|
2023
|
+
protected _resourceHandle(content: {
|
|
2024
|
+
/**
|
|
2025
|
+
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
2026
|
+
* * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
|
|
2027
|
+
* * 否则认为该消息是由旧版本 RTCLib 主动发出的增量变更消息,需要处理
|
|
2028
|
+
*/
|
|
2029
|
+
ignore?: boolean;
|
|
2030
|
+
/**
|
|
2031
|
+
* 发布到房间内的资源列表,`RTCMessageName.TOTAL_CONTENT_RESOURCE` 消息携带全量数据,否则为增量数据
|
|
2032
|
+
*/
|
|
2033
|
+
uris: IPublishedResource[];
|
|
2034
|
+
}, messageType: string, userId: string): Promise<void>;
|
|
1872
2035
|
private _onTrackPublish;
|
|
1873
2036
|
/**
|
|
1874
2037
|
* 处理 `RCRTCMessageType.STATE` 消息
|
|
@@ -2003,8 +2166,11 @@ declare abstract class RCAbstractRoom {
|
|
|
2003
2166
|
* ice 断线后,尝试重新走 exchange
|
|
2004
2167
|
*/
|
|
2005
2168
|
protected _reTryExchange(): Promise<void>;
|
|
2006
|
-
|
|
2007
|
-
|
|
2169
|
+
protected _exchangeHandle(body: IExchangeReqBody): Promise<{
|
|
2170
|
+
code: RCRTCCode;
|
|
2171
|
+
data?: IExchangeResponse | undefined;
|
|
2172
|
+
}>;
|
|
2173
|
+
protected _getRTCReqestHeaders(): IRTCReqHeader;
|
|
2008
2174
|
/**
|
|
2009
2175
|
* 获取 exchange 接口的请求体数据
|
|
2010
2176
|
* @param subscribeList 订阅清单
|
|
@@ -2040,6 +2206,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2040
2206
|
*/
|
|
2041
2207
|
subscribe(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
2042
2208
|
code: RCRTCCode;
|
|
2209
|
+
failedList?: ISubscribeAttr[];
|
|
2043
2210
|
}>;
|
|
2044
2211
|
private __subscribe;
|
|
2045
2212
|
/**
|
|
@@ -2048,6 +2215,7 @@ declare abstract class RCAbstractRoom {
|
|
|
2048
2215
|
*/
|
|
2049
2216
|
unsubscribe(tracks: RCRemoteTrack[]): Promise<{
|
|
2050
2217
|
code: RCRTCCode;
|
|
2218
|
+
failedList?: ISubscribeAttr[];
|
|
2051
2219
|
}>;
|
|
2052
2220
|
private __unsubscribe;
|
|
2053
2221
|
protected _assertRoomDestroyed(): RCRTCCode | undefined;
|
|
@@ -2097,13 +2265,15 @@ declare abstract class RCAbstractRoom {
|
|
|
2097
2265
|
/**
|
|
2098
2266
|
* 断线重连后尝试补发断线过程中的通知信息
|
|
2099
2267
|
*/
|
|
2100
|
-
__onReconnected(livingType?: RCLivingType): Promise<
|
|
2268
|
+
__onReconnected(livingType?: RCLivingType): Promise<{
|
|
2269
|
+
data: IJoinRTCRoomData | undefined;
|
|
2270
|
+
} | void>;
|
|
2101
2271
|
private _onAudioMuteChange;
|
|
2102
2272
|
private _onVideoMuteChange;
|
|
2103
2273
|
/**
|
|
2104
2274
|
* 观众切换为主播后直接处理人员变更及资源变更
|
|
2105
2275
|
*/
|
|
2106
|
-
|
|
2276
|
+
protected _afterChangedRole(data: IJoinRTCRoomData): void;
|
|
2107
2277
|
/**
|
|
2108
2278
|
* 主播身份降级,取消己端已发布的所有资源
|
|
2109
2279
|
*/
|
|
@@ -2137,6 +2307,10 @@ declare class RCMCUConfigBuilder {
|
|
|
2137
2307
|
* trackId 有效性验证方法
|
|
2138
2308
|
*/
|
|
2139
2309
|
private readonly _isValidTrackId;
|
|
2310
|
+
/**
|
|
2311
|
+
* 扩散 cdn_uris
|
|
2312
|
+
*/
|
|
2313
|
+
private readonly _sendCDNInfoSignal;
|
|
2140
2314
|
/**
|
|
2141
2315
|
* mcu 配置数据,每次向服务器提交全量数据
|
|
2142
2316
|
*/
|
|
@@ -2151,7 +2325,11 @@ declare class RCMCUConfigBuilder {
|
|
|
2151
2325
|
/**
|
|
2152
2326
|
* trackId 有效性验证方法
|
|
2153
2327
|
*/
|
|
2154
|
-
_isValidTrackId: (trackId: string) => boolean
|
|
2328
|
+
_isValidTrackId: (trackId: string) => boolean,
|
|
2329
|
+
/**
|
|
2330
|
+
* 扩散 cdn_uris
|
|
2331
|
+
*/
|
|
2332
|
+
_sendCDNInfoSignal: () => void);
|
|
2155
2333
|
/**
|
|
2156
2334
|
* 设置合流后的主位置显示的视频流
|
|
2157
2335
|
* @param videoTrackId 视频流资源 Id
|
|
@@ -2282,6 +2460,11 @@ declare class RCMCUConfigBuilder {
|
|
|
2282
2460
|
declare class RCLivingRoom extends RCAbstractRoom {
|
|
2283
2461
|
private _livingType;
|
|
2284
2462
|
readonly _mcuConfigBuilder: RCMCUConfigBuilder;
|
|
2463
|
+
/**
|
|
2464
|
+
* cdn_uris 信令扩散数据
|
|
2465
|
+
*/
|
|
2466
|
+
private _CDNUris;
|
|
2467
|
+
private _CDNEnable;
|
|
2285
2468
|
constructor(context: RTCPluginContext, runtime: IRuntime, roomId: string, data: IJoinRTCRoomData, service: RCMediaService, initOptions: IRCRTCInitOptions, clientEvent: Function, _livingType: RCLivingType, isUpgrage?: boolean);
|
|
2286
2469
|
getLivingType(): RCLivingType;
|
|
2287
2470
|
/**
|
|
@@ -2293,7 +2476,67 @@ declare class RCLivingRoom extends RCAbstractRoom {
|
|
|
2293
2476
|
* @param data
|
|
2294
2477
|
*/
|
|
2295
2478
|
private _onMCUConfigFlush;
|
|
2479
|
+
/**
|
|
2480
|
+
* 主播端断线重连后,需更新内存中的 CDN 数据
|
|
2481
|
+
* 判断房间内 CDN 状态是否和内存数据一致,不一致时需通知到客户端
|
|
2482
|
+
*/
|
|
2296
2483
|
__onReconnected(): Promise<void>;
|
|
2484
|
+
/**
|
|
2485
|
+
* 开启/停用推 CDN
|
|
2486
|
+
*/
|
|
2487
|
+
enableInnerCDN(enable: boolean): Promise<{
|
|
2488
|
+
code: RCRTCCode;
|
|
2489
|
+
}>;
|
|
2490
|
+
/**
|
|
2491
|
+
* 开启、停用 CDN 推资源后发信令
|
|
2492
|
+
*/
|
|
2493
|
+
private _sendCDNInfoSignal;
|
|
2494
|
+
/**
|
|
2495
|
+
* 扩散 cdn_uris 资源
|
|
2496
|
+
*/
|
|
2497
|
+
private _spreadCDNInfo;
|
|
2498
|
+
/**
|
|
2499
|
+
* 给房间设置 CDN 数据
|
|
2500
|
+
*/
|
|
2501
|
+
private _setRoomCDNInfo;
|
|
2502
|
+
/**
|
|
2503
|
+
* 资源变化时触发
|
|
2504
|
+
* 直播房间需单独处理 cdn_uris
|
|
2505
|
+
*/
|
|
2506
|
+
protected _resourceHandle(content: {
|
|
2507
|
+
/**
|
|
2508
|
+
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
2509
|
+
* * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
|
|
2510
|
+
* * 否则认为该消息是由旧版本 RTCLib 主动发出的增量变更消息,需要处理
|
|
2511
|
+
*/
|
|
2512
|
+
ignore?: boolean;
|
|
2513
|
+
/**
|
|
2514
|
+
* 发布到房间内的资源列表,`RTCMessageName.TOTAL_CONTENT_RESOURCE` 消息携带全量数据,否则为增量数据
|
|
2515
|
+
*/
|
|
2516
|
+
uris: IPublishedResource[];
|
|
2517
|
+
cdn_uris?: ICDNUris[];
|
|
2518
|
+
}, messageType: string, userId: string): Promise<void>;
|
|
2519
|
+
/**
|
|
2520
|
+
* 重写父类 _exchangeHandle 方法
|
|
2521
|
+
*/
|
|
2522
|
+
protected _exchangeHandle(body: IExchangeReqBody): Promise<{
|
|
2523
|
+
code: RCRTCCode;
|
|
2524
|
+
data?: IExchangeResponse | undefined;
|
|
2525
|
+
}>;
|
|
2526
|
+
/**
|
|
2527
|
+
* 观众切换为主播后直接处理人员变更及资源变更
|
|
2528
|
+
*/
|
|
2529
|
+
protected _afterChangedRole(data: IJoinRTCRoomData): void;
|
|
2530
|
+
/**
|
|
2531
|
+
* 返回 CDN 是否可用
|
|
2532
|
+
* @returns boolean
|
|
2533
|
+
*/
|
|
2534
|
+
__getCDNEnable(): boolean | undefined;
|
|
2535
|
+
/**
|
|
2536
|
+
* 返回 CDN 推送模式: 自动 or 手动
|
|
2537
|
+
* @returns boolean
|
|
2538
|
+
*/
|
|
2539
|
+
__getCDNPushMode(): RCInnerCDNPushMode | undefined;
|
|
2297
2540
|
}
|
|
2298
2541
|
|
|
2299
2542
|
/**
|
|
@@ -2390,7 +2633,7 @@ declare class RCRTCClient {
|
|
|
2390
2633
|
* 加入普通音视频房间
|
|
2391
2634
|
* @param roomId
|
|
2392
2635
|
*/
|
|
2393
|
-
joinRTCRoom(roomId: string
|
|
2636
|
+
joinRTCRoom(roomId: string): Promise<{
|
|
2394
2637
|
room?: RCRTCRoom;
|
|
2395
2638
|
code: RCRTCCode;
|
|
2396
2639
|
userIds?: string[];
|
|
@@ -2407,6 +2650,7 @@ declare class RCRTCClient {
|
|
|
2407
2650
|
code: RCRTCCode;
|
|
2408
2651
|
userIds?: string[];
|
|
2409
2652
|
tracks?: RCRemoteTrack[];
|
|
2653
|
+
CDNEnable?: boolean;
|
|
2410
2654
|
}>;
|
|
2411
2655
|
private _joinLivingRoom;
|
|
2412
2656
|
private _audience;
|
|
@@ -2547,15 +2791,6 @@ declare class RCRTCClient {
|
|
|
2547
2791
|
room?: RCAudienceLivingRoom;
|
|
2548
2792
|
code: RCRTCCode;
|
|
2549
2793
|
}>;
|
|
2550
|
-
/**
|
|
2551
|
-
* 获取在房间内用户信息
|
|
2552
|
-
* 当前仅能查自己
|
|
2553
|
-
* @since version 5.1.5
|
|
2554
|
-
*/
|
|
2555
|
-
getJoinedUserInfo(userId: string): Promise<{
|
|
2556
|
-
code: RCRTCCode;
|
|
2557
|
-
data?: IRTCJoinedInfo[];
|
|
2558
|
-
}>;
|
|
2559
2794
|
}
|
|
2560
2795
|
|
|
2561
2796
|
/**
|
|
@@ -2605,4 +2840,4 @@ declare const helper: {
|
|
|
2605
2840
|
ifSupportScreenShare: typeof ifSupportScreenShare;
|
|
2606
2841
|
};
|
|
2607
2842
|
|
|
2608
|
-
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRoomEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCCameraVideoTrack, RCFrameRate,
|
|
2843
|
+
export { BackgroundPictureFillMode, ICameraVideoProfile, IMCUOutputConfig, IMCUOutputVideoConfig, IMicphoneAudioProfile, IPublishAttrs, IPublishedResource, IRCCandidatePairStat, IRCRTCInitOptions, IRCRTCReportListener, IRCRTCStateReport, IRCTrackStat, IRoomEventListener, ISubscribeAttr, IVideoProfile, MixLayoutMode, MixVideoRenderMode, RCAbstractRoom, RCAudienceClient, RCAudienceLivingRoom, RCCameraVideoTrack, RCFrameRate, RCInnerCDNPullIsHttps, RCInnerCDNPullKind, RCLivingRoom, RCLivingType, RCLocalAudioTrack, RCLocalFileAudioTrack, RCLocalFileTrack, RCLocalFileVideoTrack, RCLocalTrack, RCLocalVideoTrack, RCMCUConfigBuilder, RCMediaType, RCMicphoneAudioTrack, RCRTCClient, RCRTCCode, RCRTCRoom, RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack, RCResolution, RCScreenVideoTrack, RCTag, RCTrack, device, helper, installer };
|