@rongcloud/plugin-rtc 5.6.6 → 5.6.8
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 +61 -21
- package/dist/index.esm.js +3 -3
- package/dist/index.js +2 -2
- package/dist/index.umd.js +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.6.
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.6.8
|
|
3
|
+
* CommitId - 5b57db6e6132740cd12ae9f67466cab1090ce82c
|
|
4
|
+
* Fri Jan 06 2023 15:07:57 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, BasicLogger, INaviInfo, RTCPluginContext, AbsCodec, IPromiseResult, ErrorCode, KVString, IRuntime, IAsyncRes, ConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage, EnableLogL, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -1558,6 +1558,16 @@ declare class RTCContext {
|
|
|
1558
1558
|
}): void;
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
1561
|
+
/**
|
|
1562
|
+
* mediaServer 交互数据
|
|
1563
|
+
*/
|
|
1564
|
+
interface IMediaServerQualityData {
|
|
1565
|
+
rsid: string;
|
|
1566
|
+
rsdur: number;
|
|
1567
|
+
msa: string;
|
|
1568
|
+
rscod: number;
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1561
1571
|
declare class RCMediaService {
|
|
1562
1572
|
private readonly _runtime;
|
|
1563
1573
|
private readonly _context;
|
|
@@ -1601,6 +1611,7 @@ declare class RCMediaService {
|
|
|
1601
1611
|
private static detectValidMinute;
|
|
1602
1612
|
static jwtToken: string;
|
|
1603
1613
|
private _msList;
|
|
1614
|
+
private _qualityMsList;
|
|
1604
1615
|
constructor(_runtime: IRuntime, _context: RTCContext,
|
|
1605
1616
|
/**
|
|
1606
1617
|
* 自定义 MediaServer 地址,当有值时,不再使用导航内的地址
|
|
@@ -1640,6 +1651,7 @@ declare class RCMediaService {
|
|
|
1640
1651
|
exchange(headers: IRTCReqHeader, body: IExchangeReqBody, traceId: string, isNeedUpdateMsas?: boolean): Promise<{
|
|
1641
1652
|
code: RCRTCCode;
|
|
1642
1653
|
data?: IExchangeResponse | undefined;
|
|
1654
|
+
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
1643
1655
|
}>;
|
|
1644
1656
|
/**
|
|
1645
1657
|
* 退出房间
|
|
@@ -1651,6 +1663,7 @@ declare class RCMediaService {
|
|
|
1651
1663
|
broadcastSubscribe(headers: IRTCReqHeader, body: IBroadcastSubReqBody): Promise<{
|
|
1652
1664
|
code: RCRTCCode;
|
|
1653
1665
|
data?: IBroadcastSubRespBody | undefined;
|
|
1666
|
+
qualityMsList?: IMediaServerQualityData[] | undefined;
|
|
1654
1667
|
}>;
|
|
1655
1668
|
/**
|
|
1656
1669
|
* 观众端退出订阅
|
|
@@ -1712,6 +1725,8 @@ declare class RCRTCPeerConnection extends EventEmitter {
|
|
|
1712
1725
|
protected readonly _initOptions?: IRCRTCInitOptions | undefined;
|
|
1713
1726
|
static __INNER_EVENT_TRACK_READY__: string;
|
|
1714
1727
|
static __INNER_AUDIOLEVEL_CHANGE__: string;
|
|
1728
|
+
static __INNER_ICE_STATE_CHANGE__: string;
|
|
1729
|
+
static __INNER_ICE_CONNECTED__: string;
|
|
1715
1730
|
private readonly senderAndReciveSize;
|
|
1716
1731
|
private readonly _rtcPeerConn;
|
|
1717
1732
|
private readonly _sdpStrategy;
|
|
@@ -2366,6 +2381,17 @@ declare class RCLivingPKHandler {
|
|
|
2366
2381
|
};
|
|
2367
2382
|
}
|
|
2368
2383
|
|
|
2384
|
+
declare enum RCKickReason {
|
|
2385
|
+
/**
|
|
2386
|
+
* Server 主动踢(掉 Server API 踢出)
|
|
2387
|
+
*/
|
|
2388
|
+
SERVER_KICK = 1,
|
|
2389
|
+
/**
|
|
2390
|
+
* 其他设备登陆后,本端被踢
|
|
2391
|
+
*/
|
|
2392
|
+
OTHER_KICK = 2
|
|
2393
|
+
}
|
|
2394
|
+
|
|
2369
2395
|
type ResourceMsgContent = {
|
|
2370
2396
|
/**
|
|
2371
2397
|
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
@@ -2413,6 +2439,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
2413
2439
|
protected _peerCManager: RCRTCPeerCManager | null;
|
|
2414
2440
|
protected readonly _invoker: Invoker;
|
|
2415
2441
|
protected readonly _store: ReadableStore;
|
|
2442
|
+
private readonly _reportMediaActionLogger;
|
|
2416
2443
|
/**
|
|
2417
2444
|
* RCRTCRoom 类的构造函数。
|
|
2418
2445
|
* @param {RTCContext} _context - RTC上下文,
|
|
@@ -2473,7 +2500,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
2473
2500
|
* @param messageType 消息类型
|
|
2474
2501
|
* @param userId 消息发送者
|
|
2475
2502
|
*/
|
|
2476
|
-
protected _resourceHandle(content: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, userId: string, traceId: string): Promise<void>;
|
|
2503
|
+
protected _resourceHandle(content: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, userId: string, sentTime: number, traceId: string): Promise<void>;
|
|
2477
2504
|
private _onTrackPublish;
|
|
2478
2505
|
/**
|
|
2479
2506
|
* 处理 `RCRTCMessageType.STATE` 消息
|
|
@@ -2871,6 +2898,15 @@ declare class RCAudienceLivingRoom {
|
|
|
2871
2898
|
private _pullTime;
|
|
2872
2899
|
private _store;
|
|
2873
2900
|
private _crtUserId;
|
|
2901
|
+
private readonly _reportMediaActionLogger;
|
|
2902
|
+
/**
|
|
2903
|
+
* 行为开始时间
|
|
2904
|
+
*/
|
|
2905
|
+
private _actionStartTime;
|
|
2906
|
+
/**
|
|
2907
|
+
* track 对应的 mediaServer 信息
|
|
2908
|
+
*/
|
|
2909
|
+
private _trackMediaMap;
|
|
2874
2910
|
constructor(_context: RTCContext, _runtime: IRuntime, _initOptions: IRCRTCInitOptions, _roomId: string, _joinResData: {
|
|
2875
2911
|
token: string;
|
|
2876
2912
|
kvEntries: IServerRTCRoomEntry[];
|
|
@@ -3262,17 +3298,6 @@ declare enum RCInnerCDNPullIsHttps {
|
|
|
3262
3298
|
HTTPS = 1
|
|
3263
3299
|
}
|
|
3264
3300
|
|
|
3265
|
-
declare enum RCKickReason {
|
|
3266
|
-
/**
|
|
3267
|
-
* Server 主动踢(掉 Server API 踢出)
|
|
3268
|
-
*/
|
|
3269
|
-
SERVER_KICK = 1,
|
|
3270
|
-
/**
|
|
3271
|
-
* 其他设备登陆后,本端被踢
|
|
3272
|
-
*/
|
|
3273
|
-
OTHER_KICK = 2
|
|
3274
|
-
}
|
|
3275
|
-
|
|
3276
3301
|
declare enum RCRTCPingResult {
|
|
3277
3302
|
SUCCESS = "Success",
|
|
3278
3303
|
FAIL = "Fail"
|
|
@@ -4031,8 +4056,26 @@ interface ICameraVideoProfile extends IVideoProfile {
|
|
|
4031
4056
|
faceMode?: 'user' | 'environment';
|
|
4032
4057
|
}
|
|
4033
4058
|
interface IMicphoneAudioProfile {
|
|
4059
|
+
/**
|
|
4060
|
+
* 指定采录的 AudioInputDevice
|
|
4061
|
+
*/
|
|
4034
4062
|
micphoneId?: string;
|
|
4063
|
+
/**
|
|
4064
|
+
* 音频采样率
|
|
4065
|
+
*/
|
|
4035
4066
|
sampleRate?: number;
|
|
4067
|
+
/**
|
|
4068
|
+
* 噪声抑制开关,未配置时以浏览器默认行为为准
|
|
4069
|
+
*/
|
|
4070
|
+
noiseSuppression?: boolean;
|
|
4071
|
+
/**
|
|
4072
|
+
* 回声消除开关,未配置时以浏览器默认行为为准
|
|
4073
|
+
*/
|
|
4074
|
+
echoCancellation?: boolean;
|
|
4075
|
+
/**
|
|
4076
|
+
* 自动增益开关,未配置时以浏览器默认行为为准
|
|
4077
|
+
*/
|
|
4078
|
+
autoGainControl?: boolean;
|
|
4036
4079
|
}
|
|
4037
4080
|
interface ICreateLocalTrackOptions {
|
|
4038
4081
|
/**
|
|
@@ -4492,7 +4535,7 @@ declare class RCLivingRoom extends RCAbstractRoom {
|
|
|
4492
4535
|
* 是否使用多 peerConnection
|
|
4493
4536
|
*/
|
|
4494
4537
|
useMutilPeerC?: boolean, _clientSessionId?: string);
|
|
4495
|
-
private
|
|
4538
|
+
private _initRoomPKHandler;
|
|
4496
4539
|
/**
|
|
4497
4540
|
* @override
|
|
4498
4541
|
*/
|
|
@@ -4532,11 +4575,7 @@ declare class RCLivingRoom extends RCAbstractRoom {
|
|
|
4532
4575
|
*/
|
|
4533
4576
|
protected _resourceHandle(content: ResourceMsgContent & {
|
|
4534
4577
|
cdn_uris?: ICDNUris[];
|
|
4535
|
-
}, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, userId: string, traceId: string): Promise<void>;
|
|
4536
|
-
/**
|
|
4537
|
-
* 观众切换为主播后直接处理人员变更及资源变更
|
|
4538
|
-
*/
|
|
4539
|
-
protected _afterChangedRole(data: IJoinRTCRoomData, traceId: string): void;
|
|
4578
|
+
}, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, userId: string, sentTime: number, traceId: string): Promise<void>;
|
|
4540
4579
|
/**
|
|
4541
4580
|
* 返回 CDN 是否可用
|
|
4542
4581
|
* @returns boolean
|
|
@@ -4929,6 +4968,7 @@ declare class RCRTCClient extends RCMediaStreamCapture {
|
|
|
4929
4968
|
code: RCRTCCode;
|
|
4930
4969
|
userIds?: string[];
|
|
4931
4970
|
tracks?: RCRemoteTrack[];
|
|
4971
|
+
CDNEnable?: boolean;
|
|
4932
4972
|
}>;
|
|
4933
4973
|
/**
|
|
4934
4974
|
* 降级为观众房间
|