@rongcloud/plugin-rtc 5.4.4-alpha.2 → 5.4.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/core/Invoker.d.ts +8 -0
- package/dist/core/Store.d.ts +5 -1
- package/dist/core/command/AsyncCommand.d.ts +55 -0
- package/dist/core/command/AsyncSubscribeCommand.d.ts +28 -0
- package/dist/core/command/AsyncUnsubscribeCommand.d.ts +28 -0
- package/dist/core/command/AsyncUpdateSubscribeListCommand.d.ts +25 -0
- package/dist/core/command/BaseCommand.d.ts +9 -0
- package/dist/core/command/JoinRoomCommand.d.ts +2 -0
- package/dist/core/command/LeaveOtherRoomCommand.d.ts +2 -0
- package/dist/core/command/OnRemoteUserUnpubCommand.d.ts +2 -2
- package/dist/core/command/OnSignalReconnectedCommand.d.ts +2 -2
- package/dist/core/command/ParseRemoteResCommand.d.ts +2 -2
- package/dist/core/command/ParseUserStateCommand.d.ts +2 -2
- package/dist/core/command/{PubCommand.d.ts → PublishCommand.d.ts} +4 -2
- package/dist/core/command/{SubCommand.d.ts → SubscribeCommand.d.ts} +4 -4
- package/dist/core/command/{UnpubCommand.d.ts → UnpublishCommand.d.ts} +4 -2
- package/dist/core/command/UnpublishPrevCommand.d.ts +11 -0
- package/dist/core/command/{UnsubCommand.d.ts → UnsubscribeCommand.d.ts} +4 -4
- package/dist/core/command/{UpdateSubListCommand.d.ts → UpdateSubscribeListCommand.d.ts} +5 -5
- package/dist/core/enums/RCCommandKind.d.ts +12 -0
- package/dist/core/enums/RCLinkedListPoint.d.ts +6 -0
- package/dist/core/enums/RCLoggerTag.d.ts +13 -1
- package/dist/core/enums/inner/RCRTCMessageType.d.ts +5 -1
- package/dist/core/interfaces.d.ts +19 -0
- package/dist/core/room/RCAbstractRoom.d.ts +30 -7
- package/dist/core/room/RCAudienceLivingRoom.d.ts +8 -0
- package/dist/core/tracks/RC3AnoiseTrack.d.ts +27 -0
- package/dist/core/tracks/RCLocalTrack.d.ts +14 -0
- package/dist/core/tracks/RCTrack.d.ts +5 -0
- package/dist/core/webrtc/RCRTCPeerCManager.d.ts +2 -0
- package/dist/index.d.ts +116 -12
- package/dist/index.esm.js +15 -18244
- package/dist/index.js +15 -18276
- package/dist/index.umd.js +15 -18280
- package/package.json +2 -2
- package/dist/core/command/UnpubPrevCommand.d.ts +0 -6
|
@@ -61,6 +61,13 @@ export declare class RCLocalAudioTrack extends RCLocalTrack {
|
|
|
61
61
|
* @param {number[]} args - [分钟,开始]
|
|
62
62
|
*/
|
|
63
63
|
setBitrate(max: number, ...args: number[]): void;
|
|
64
|
+
protected _stopProcess: Function;
|
|
65
|
+
/**
|
|
66
|
+
* @override __innerSetMediaStreamTrack
|
|
67
|
+
* @params {track} MediaStreamTrack 添加音频流
|
|
68
|
+
* @params {track} undefined 销毁音频流
|
|
69
|
+
*/
|
|
70
|
+
__innerSetMediaStreamTrack(track: MediaStreamTrack | undefined): void;
|
|
64
71
|
}
|
|
65
72
|
export declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
66
73
|
private _isTiny;
|
|
@@ -109,6 +116,13 @@ export declare class RCLocalFileAudioTrack extends RCLocalFileTrack {
|
|
|
109
116
|
play(): Promise<{
|
|
110
117
|
code: RCRTCCode;
|
|
111
118
|
}>;
|
|
119
|
+
protected _stopProcess: Function;
|
|
120
|
+
/**
|
|
121
|
+
* @override __innerSetMediaStreamTrack
|
|
122
|
+
* @params {track} MediaStreamTrack 添加音频流
|
|
123
|
+
* @params {track} undefined 销毁音频流
|
|
124
|
+
*/
|
|
125
|
+
__innerSetMediaStreamTrack(track: MediaStreamTrack | undefined): void;
|
|
112
126
|
}
|
|
113
127
|
export declare class RCMicphoneAudioTrack extends RCLocalAudioTrack {
|
|
114
128
|
}
|
|
@@ -28,6 +28,11 @@ export declare abstract class RCTrack extends EventEmitter {
|
|
|
28
28
|
*/
|
|
29
29
|
getUserId(): string;
|
|
30
30
|
__innerGetMediaStreamTrack(): MediaStreamTrack | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* 它返回 MediaStreamTrack 对象。
|
|
33
|
+
* @returns 表示媒体源的 MediaStreamTrack 对象。
|
|
34
|
+
*/
|
|
35
|
+
get streamTrack(): (MediaStreamTrack | undefined);
|
|
31
36
|
/**
|
|
32
37
|
* 获取数据标识
|
|
33
38
|
* @returns
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* RCRTC - v5.4.4
|
|
3
|
-
* CommitId -
|
|
4
|
-
*
|
|
2
|
+
* RCRTC - v5.4.4
|
|
3
|
+
* CommitId - bc1f8f530851278c199d53868ad7c199d465f45e
|
|
4
|
+
* Tue Aug 09 2022 15:25:48 GMT+0800 (China Standard Time)
|
|
5
5
|
* ©2020 RongCloud, Inc. All rights reserved.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, RTCMode, IRuntime, RTCPluginContext, IJoinRTCRoomData, IReceivedMessage, ErrorCode, RTCJoinType, IRTCUserData, KVString, IServerRTCRoomEntry, LogLevel, IRTCJoinedInfo, IPluginGenerator } from '@rongcloud/engine';
|
|
@@ -174,6 +174,11 @@ declare abstract class RCTrack extends EventEmitter {
|
|
|
174
174
|
*/
|
|
175
175
|
getUserId(): string;
|
|
176
176
|
__innerGetMediaStreamTrack(): MediaStreamTrack | undefined;
|
|
177
|
+
/**
|
|
178
|
+
* 它返回 MediaStreamTrack 对象。
|
|
179
|
+
* @returns 表示媒体源的 MediaStreamTrack 对象。
|
|
180
|
+
*/
|
|
181
|
+
get streamTrack(): (MediaStreamTrack | undefined);
|
|
177
182
|
/**
|
|
178
183
|
* 获取数据标识
|
|
179
184
|
* @returns
|
|
@@ -334,6 +339,13 @@ declare class RCLocalAudioTrack extends RCLocalTrack {
|
|
|
334
339
|
* @param {number[]} args - [分钟,开始]
|
|
335
340
|
*/
|
|
336
341
|
setBitrate(max: number, ...args: number[]): void;
|
|
342
|
+
protected _stopProcess: Function;
|
|
343
|
+
/**
|
|
344
|
+
* @override __innerSetMediaStreamTrack
|
|
345
|
+
* @params {track} MediaStreamTrack 添加音频流
|
|
346
|
+
* @params {track} undefined 销毁音频流
|
|
347
|
+
*/
|
|
348
|
+
__innerSetMediaStreamTrack(track: MediaStreamTrack | undefined): void;
|
|
337
349
|
}
|
|
338
350
|
declare class RCLocalVideoTrack extends RCLocalTrack {
|
|
339
351
|
private _isTiny;
|
|
@@ -382,6 +394,13 @@ declare class RCLocalFileAudioTrack extends RCLocalFileTrack {
|
|
|
382
394
|
play(): Promise<{
|
|
383
395
|
code: RCRTCCode;
|
|
384
396
|
}>;
|
|
397
|
+
protected _stopProcess: Function;
|
|
398
|
+
/**
|
|
399
|
+
* @override __innerSetMediaStreamTrack
|
|
400
|
+
* @params {track} MediaStreamTrack 添加音频流
|
|
401
|
+
* @params {track} undefined 销毁音频流
|
|
402
|
+
*/
|
|
403
|
+
__innerSetMediaStreamTrack(track: MediaStreamTrack | undefined): void;
|
|
385
404
|
}
|
|
386
405
|
declare class RCMicphoneAudioTrack extends RCLocalAudioTrack {
|
|
387
406
|
}
|
|
@@ -573,7 +592,11 @@ declare enum RCRTCMessageType {
|
|
|
573
592
|
/**
|
|
574
593
|
* 连麦的房间不再了或离线了,主直播房间会收到的消息通知
|
|
575
594
|
*/
|
|
576
|
-
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline"
|
|
595
|
+
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline",
|
|
596
|
+
/**
|
|
597
|
+
* 订阅、取消订阅动作成功
|
|
598
|
+
*/
|
|
599
|
+
ROOM_TASK_FINISH = "RCRTC:roomTaskFinish"
|
|
577
600
|
}
|
|
578
601
|
|
|
579
602
|
declare enum RCInnerCDNPushMode {
|
|
@@ -1255,6 +1278,18 @@ declare enum RCLivingType {
|
|
|
1255
1278
|
AUDIO = 1
|
|
1256
1279
|
}
|
|
1257
1280
|
|
|
1281
|
+
declare enum RCCommandKind {
|
|
1282
|
+
Unknow = 0,
|
|
1283
|
+
Publish = 1,
|
|
1284
|
+
UnPublish = 2,
|
|
1285
|
+
JoinRoom = 3,
|
|
1286
|
+
LeaveRoom = 4,
|
|
1287
|
+
UpdateSubscribeTask = 5,
|
|
1288
|
+
SubscribedTask = 6,
|
|
1289
|
+
UnSubscribedTask = 7,
|
|
1290
|
+
AsyncCommand = "AsyncCommand"
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1258
1293
|
declare class RCRTCPeerCManager {
|
|
1259
1294
|
/**
|
|
1260
1295
|
* 是否使用多 peerConnection
|
|
@@ -1328,6 +1363,8 @@ declare class RCRTCPeerCManager {
|
|
|
1328
1363
|
private _createOnePeerCItem;
|
|
1329
1364
|
/**
|
|
1330
1365
|
* 创建一组 peerC
|
|
1366
|
+
* 为了适应多 peerConnection 的场景做出的冗余设计,对单 peerConnection 进行数组进行封装
|
|
1367
|
+
* 提示:useMutilPeerC 用户自定义的,没有明确场景,必须使用多 peerConnection
|
|
1331
1368
|
* @param pcName
|
|
1332
1369
|
* @returns
|
|
1333
1370
|
*/
|
|
@@ -1434,7 +1471,8 @@ declare abstract class ReadableStore {
|
|
|
1434
1471
|
/**
|
|
1435
1472
|
* 已订阅参数
|
|
1436
1473
|
*/
|
|
1437
|
-
protected
|
|
1474
|
+
protected _subscribedList: ISubscribeAttr[];
|
|
1475
|
+
protected _collectSubscribeList: ISubscribeAttr[];
|
|
1438
1476
|
/**
|
|
1439
1477
|
* 与 MediaServer 交互需要的 token 信息
|
|
1440
1478
|
*/
|
|
@@ -1461,6 +1499,7 @@ declare abstract class ReadableStore {
|
|
|
1461
1499
|
getAllUserIds(): string[];
|
|
1462
1500
|
getRemoteUserIds(): string[];
|
|
1463
1501
|
getSubscribedList(): ISubscribeAttr[];
|
|
1502
|
+
getCollectSubscribeList(): ISubscribeAttr[];
|
|
1464
1503
|
getPublishedResourceByTrackId(trackId: string): IPublishedResource | undefined;
|
|
1465
1504
|
getToken(): string;
|
|
1466
1505
|
getLocalTrack(trackId: string): RCLocalTrack | null;
|
|
@@ -1480,6 +1519,8 @@ declare class Store extends ReadableStore {
|
|
|
1480
1519
|
removeRemoteTracks(): void;
|
|
1481
1520
|
setCDNEnabel(bool: boolean): void;
|
|
1482
1521
|
setCDNUris(uris: ICDNUris | null): void;
|
|
1522
|
+
resetSubscribedList(subscribeList: ISubscribeAttr[]): void;
|
|
1523
|
+
resetCollectSubscribeList(collectSubscribeList: ISubscribeAttr[]): void;
|
|
1483
1524
|
}
|
|
1484
1525
|
|
|
1485
1526
|
declare enum CommandPriority {
|
|
@@ -1500,6 +1541,11 @@ declare abstract class BaseCommand<RES, STORE = Store> {
|
|
|
1500
1541
|
* 获取指令优先级,必要时可 override 此函数
|
|
1501
1542
|
*/
|
|
1502
1543
|
get priority(): CommandPriority;
|
|
1544
|
+
/**
|
|
1545
|
+
* 它返回命令的种类。
|
|
1546
|
+
* @returns 命令的种类。
|
|
1547
|
+
*/
|
|
1548
|
+
get kind(): RCCommandKind;
|
|
1503
1549
|
}
|
|
1504
1550
|
|
|
1505
1551
|
declare class BaseInvoker<STORE> {
|
|
@@ -1526,6 +1572,14 @@ declare class BaseInvoker<STORE> {
|
|
|
1526
1572
|
private _execute;
|
|
1527
1573
|
push<R>(command: BaseCommand<R, STORE>): Promise<R>;
|
|
1528
1574
|
private _isDestroyed;
|
|
1575
|
+
/**
|
|
1576
|
+
* 查找出 RCCommandKind.AsyncCommand 类型的 Command,并将其从队列中删除
|
|
1577
|
+
* 并使用最新的一次 Command 接管它的 resolve & reject
|
|
1578
|
+
* @param resolve
|
|
1579
|
+
* @param reject
|
|
1580
|
+
* @returns 具有两个属性的对象,resolve 和 reject。
|
|
1581
|
+
*/
|
|
1582
|
+
private commandOffset;
|
|
1529
1583
|
isDestroyed(): boolean;
|
|
1530
1584
|
destroy(): void;
|
|
1531
1585
|
}
|
|
@@ -1951,6 +2005,12 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
1951
2005
|
code: RCRTCCode;
|
|
1952
2006
|
failedList?: ISubscribeAttr[];
|
|
1953
2007
|
}>;
|
|
2008
|
+
/**
|
|
2009
|
+
* 它将订阅任务添加到队列中。
|
|
2010
|
+
* @param {(RCRemoteTrack | ISubscribeAttr)[]} tracks - (RCRemoteTrack | ISubscribeAttr)[]
|
|
2011
|
+
* @returns 一个用代码和失败列表解析为对象的承诺。
|
|
2012
|
+
*/
|
|
2013
|
+
addSubscribeTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): void;
|
|
1954
2014
|
/**
|
|
1955
2015
|
* 取消订阅资源
|
|
1956
2016
|
* @param tracks 预取消远端资源
|
|
@@ -1959,6 +2019,27 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
1959
2019
|
code: RCRTCCode;
|
|
1960
2020
|
failedList?: ISubscribeAttr[];
|
|
1961
2021
|
}>;
|
|
2022
|
+
/**
|
|
2023
|
+
* 它将取消订阅任务添加到队列中。
|
|
2024
|
+
* @param {RCRemoteTrack[]} tracks - 要取消订阅的曲目。
|
|
2025
|
+
* @returns 一个用代码和失败列表解析为对象的承诺。
|
|
2026
|
+
*/
|
|
2027
|
+
addUnsubscribeTask(tracks: RCRemoteTrack[]): void;
|
|
2028
|
+
/**
|
|
2029
|
+
* 强制修改订阅列表,仅订阅数组中的资源,取消订阅其他已订阅资源。
|
|
2030
|
+
* 当参数为 `[]` 时,意味着不再订阅任何资源
|
|
2031
|
+
* @param tracks 变更的资源列表
|
|
2032
|
+
*/
|
|
2033
|
+
updateSubList(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
2034
|
+
code: RCRTCCode;
|
|
2035
|
+
failedList?: ISubscribeAttr[];
|
|
2036
|
+
}>;
|
|
2037
|
+
/**
|
|
2038
|
+
* 将任务添加到任务队列的函数。
|
|
2039
|
+
* @param {(RCRemoteTrack | ISubscribeAttr)[]} tracks - (RCRemoteTrack | ISubscribeAttr)[]
|
|
2040
|
+
*/
|
|
2041
|
+
addUpdateSubscribeListTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): void;
|
|
2042
|
+
private _onTaskCompleted;
|
|
1962
2043
|
/**
|
|
1963
2044
|
* 获取已发布的本地资源
|
|
1964
2045
|
* @param trackId
|
|
@@ -1976,14 +2057,10 @@ declare abstract class RCAbstractRoom extends EventEmitter {
|
|
|
1976
2057
|
*/
|
|
1977
2058
|
getRemoteTrack(trackId: string): RCRemoteTrack | null;
|
|
1978
2059
|
/**
|
|
1979
|
-
*
|
|
1980
|
-
*
|
|
1981
|
-
* @param tracks 变更的资源列表
|
|
2060
|
+
* 获取当前已经订阅的全量资源
|
|
2061
|
+
* returns subscribedTracks ISubscribeAttr[]
|
|
1982
2062
|
*/
|
|
1983
|
-
|
|
1984
|
-
code: RCRTCCode;
|
|
1985
|
-
failedList?: ISubscribeAttr[];
|
|
1986
|
-
}>;
|
|
2063
|
+
get subscribedTracks(): ISubscribeAttr[];
|
|
1987
2064
|
private _appListener;
|
|
1988
2065
|
/**
|
|
1989
2066
|
* 注册事件监听器,多次注册会导致后者覆盖前者,可以通过使用 `registerRoomEventListener(null)` 取消注册
|
|
@@ -2246,6 +2323,10 @@ declare class RCAudienceLivingRoom {
|
|
|
2246
2323
|
code: RCRTCCode;
|
|
2247
2324
|
failedList?: ISubscribeAttr[];
|
|
2248
2325
|
}>;
|
|
2326
|
+
addSubscribeTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
2327
|
+
code: RCRTCCode;
|
|
2328
|
+
failedList?: ISubscribeAttr[];
|
|
2329
|
+
}>;
|
|
2249
2330
|
private __unsubscribe;
|
|
2250
2331
|
/**
|
|
2251
2332
|
* 取消订阅资源
|
|
@@ -2255,6 +2336,10 @@ declare class RCAudienceLivingRoom {
|
|
|
2255
2336
|
code: RCRTCCode;
|
|
2256
2337
|
failedList?: ISubscribeAttr[];
|
|
2257
2338
|
}>;
|
|
2339
|
+
addUnsubscribeTask(tracks: RCRemoteTrack[]): Promise<{
|
|
2340
|
+
code: RCRTCCode;
|
|
2341
|
+
failedList?: ISubscribeAttr[];
|
|
2342
|
+
}>;
|
|
2258
2343
|
/**
|
|
2259
2344
|
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
2260
2345
|
*/
|
|
@@ -2888,6 +2973,14 @@ interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
2888
2973
|
* 主播和观众切换身份通知
|
|
2889
2974
|
*/
|
|
2890
2975
|
onSwitchRole?(userId: string, role: RCRTCLiveRole): void;
|
|
2976
|
+
/**
|
|
2977
|
+
* 房间任务完成时调用的函数。
|
|
2978
|
+
* @param code 任务完成后的状态
|
|
2979
|
+
* @param subscribe 订阅成功的列表
|
|
2980
|
+
* @param unsubscribe 取消订阅成功的列表
|
|
2981
|
+
* @param failedList 订阅失败的列表
|
|
2982
|
+
*/
|
|
2983
|
+
onTaskCompleted?(code: RCRTCCode, subscribe: ISubscribeAttr[], unsubscribe: ISubscribeAttr[], failedList: ISubscribeAttr[]): void;
|
|
2891
2984
|
}
|
|
2892
2985
|
/**
|
|
2893
2986
|
* RTCClient 初始化配置
|
|
@@ -2935,6 +3028,17 @@ interface IRCRTCInitOptions {
|
|
|
2935
3028
|
* 观众拉内置 CDN 资源时是否使用 https,默认为 RCInnerCDNPullIsHttps.HTTPS
|
|
2936
3029
|
*/
|
|
2937
3030
|
pullInnerCDNUseHttps?: RCInnerCDNPullIsHttps;
|
|
3031
|
+
/**
|
|
3032
|
+
* 音频降噪处理
|
|
3033
|
+
* - workletModule 默认值为 https://cdn.ronghub.com/plugin-rtc/wasm/5.0.0-alpha.1/process-worklet.js
|
|
3034
|
+
* - workletWasm 默认值为 https://cdn.ronghub.com/plugin-rtc/wasm/5.0.0-alpha.1/AudioProcessing.wasm
|
|
3035
|
+
* - isOpen 默认值为 false
|
|
3036
|
+
*/
|
|
3037
|
+
audio?: {
|
|
3038
|
+
workletModule?: string;
|
|
3039
|
+
workletWasm?: string;
|
|
3040
|
+
isOpen?: boolean;
|
|
3041
|
+
};
|
|
2938
3042
|
}
|
|
2939
3043
|
interface ICameraVideoProfile extends IVideoProfile {
|
|
2940
3044
|
cameraId?: string;
|