@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
package/dist/core/Invoker.d.ts
CHANGED
|
@@ -29,6 +29,14 @@ export declare class BaseInvoker<STORE> {
|
|
|
29
29
|
private _execute;
|
|
30
30
|
push<R>(command: BaseCommand<R, STORE>): Promise<R>;
|
|
31
31
|
private _isDestroyed;
|
|
32
|
+
/**
|
|
33
|
+
* 查找出 RCCommandKind.AsyncCommand 类型的 Command,并将其从队列中删除
|
|
34
|
+
* 并使用最新的一次 Command 接管它的 resolve & reject
|
|
35
|
+
* @param resolve
|
|
36
|
+
* @param reject
|
|
37
|
+
* @returns 具有两个属性的对象,resolve 和 reject。
|
|
38
|
+
*/
|
|
39
|
+
private commandOffset;
|
|
32
40
|
isDestroyed(): boolean;
|
|
33
41
|
destroy(): void;
|
|
34
42
|
}
|
package/dist/core/Store.d.ts
CHANGED
|
@@ -30,7 +30,8 @@ export declare abstract class ReadableStore {
|
|
|
30
30
|
/**
|
|
31
31
|
* 已订阅参数
|
|
32
32
|
*/
|
|
33
|
-
protected
|
|
33
|
+
protected _subscribedList: ISubscribeAttr[];
|
|
34
|
+
protected _collectSubscribeList: ISubscribeAttr[];
|
|
34
35
|
/**
|
|
35
36
|
* 与 MediaServer 交互需要的 token 信息
|
|
36
37
|
*/
|
|
@@ -57,6 +58,7 @@ export declare abstract class ReadableStore {
|
|
|
57
58
|
getAllUserIds(): string[];
|
|
58
59
|
getRemoteUserIds(): string[];
|
|
59
60
|
getSubscribedList(): ISubscribeAttr[];
|
|
61
|
+
getCollectSubscribeList(): ISubscribeAttr[];
|
|
60
62
|
getPublishedResourceByTrackId(trackId: string): IPublishedResource | undefined;
|
|
61
63
|
getToken(): string;
|
|
62
64
|
getLocalTrack(trackId: string): RCLocalTrack | null;
|
|
@@ -76,5 +78,7 @@ export declare class Store extends ReadableStore {
|
|
|
76
78
|
removeRemoteTracks(): void;
|
|
77
79
|
setCDNEnabel(bool: boolean): void;
|
|
78
80
|
setCDNUris(uris: ICDNUris | null): void;
|
|
81
|
+
resetSubscribedList(subscribeList: ISubscribeAttr[]): void;
|
|
82
|
+
resetCollectSubscribeList(collectSubscribeList: ISubscribeAttr[]): void;
|
|
79
83
|
}
|
|
80
84
|
//# sourceMappingURL=Store.d.ts.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
2
|
+
import { RCLinkedListPoint } from '../enums/RCLinkedListPoint';
|
|
3
|
+
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
4
|
+
import { ISubscribeAttr } from '../interfaces';
|
|
5
|
+
import { Store } from '../Store';
|
|
6
|
+
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
7
|
+
import { BaseCommand } from './BaseCommand';
|
|
8
|
+
export declare type taskCompletedParams = {
|
|
9
|
+
code: RCRTCCode;
|
|
10
|
+
subscribe?: ISubscribeAttr[];
|
|
11
|
+
unsubscribe?: ISubscribeAttr[];
|
|
12
|
+
failedList?: ISubscribeAttr[];
|
|
13
|
+
};
|
|
14
|
+
export declare type AsyncCommandCallback = {
|
|
15
|
+
onTaskCompleted: (content: taskCompletedParams) => void;
|
|
16
|
+
};
|
|
17
|
+
export declare abstract class AsyncCommand<RES, STORE = Store> extends BaseCommand<RES> {
|
|
18
|
+
protected state: RCLinkedListPoint;
|
|
19
|
+
constructor(state?: RCLinkedListPoint);
|
|
20
|
+
get kind(): RCCommandKind;
|
|
21
|
+
/**
|
|
22
|
+
* `public setState(状态:RCLinkedListPoint):void`
|
|
23
|
+
*
|
|
24
|
+
* 该函数是公共的,它被称为 setState,它接受一个称为 state 的参数,它什么也不返回
|
|
25
|
+
* @param {RCLinkedListPoint} state - 链表的状态。
|
|
26
|
+
*/
|
|
27
|
+
setState(state: RCLinkedListPoint): void;
|
|
28
|
+
static AsyncSubscribeTasks: (RCRemoteTrack | ISubscribeAttr)[];
|
|
29
|
+
static AsyncUnsubscribeTasks: (RCRemoteTrack | ISubscribeAttr)[];
|
|
30
|
+
static AsyncUpdateSubscribeTasks: (RCRemoteTrack | ISubscribeAttr)[];
|
|
31
|
+
/**
|
|
32
|
+
* 该功能用于向房间发送消息,任务完成时向房间发送消息
|
|
33
|
+
* @param {Store} store - 店铺
|
|
34
|
+
* @param {RCRTCCode} code - 任务的状态码,即任务的状态码。
|
|
35
|
+
* @param {ISubscribeAttr[]} tracks - 要订阅的Tracks
|
|
36
|
+
*/
|
|
37
|
+
protected pickoutSubscribed(subscribedTracks: ISubscribeAttr[], originTracks: ISubscribeAttr[]): {
|
|
38
|
+
subscribe: ISubscribeAttr[];
|
|
39
|
+
unsubscribe: ISubscribeAttr[];
|
|
40
|
+
};
|
|
41
|
+
private calcSubscribeList;
|
|
42
|
+
/**
|
|
43
|
+
* 它需要一个轨道数组并返回一个轨道数组。
|
|
44
|
+
* @param {(RCRemoteTrack | ISubscribeAttr)[]} tracks - (RCRemoteTrack | ISubscribeAttr)[]
|
|
45
|
+
* @returns 具有 track 属性的对象数组。
|
|
46
|
+
*/
|
|
47
|
+
protected formateTrack(tracks: (RCRemoteTrack | ISubscribeAttr)[]): ISubscribeAttr[];
|
|
48
|
+
/**
|
|
49
|
+
* 它检查 Track 是否已经在订阅列表中。
|
|
50
|
+
* @param {ISubscribeAttr} track - ISubscribeAttr:要添加到列表中的 track
|
|
51
|
+
* @param {ISubscribeAttr[]} tracks - 需要订阅的 track 数组
|
|
52
|
+
*/
|
|
53
|
+
private trackInSubscribeList;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=AsyncCommand.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RCLinkedListPoint } from '../enums/RCLinkedListPoint';
|
|
2
|
+
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
3
|
+
import { ISubscribeAttr } from '../interfaces';
|
|
4
|
+
import { Invoker } from '../Invoker';
|
|
5
|
+
import { Store } from '../Store';
|
|
6
|
+
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
7
|
+
import { AsyncCommand, AsyncCommandCallback } from './AsyncCommand';
|
|
8
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
9
|
+
export declare class AsyncSubscribeCommand extends AsyncCommand<{
|
|
10
|
+
code: RCRTCCode;
|
|
11
|
+
failedList?: ISubscribeAttr[];
|
|
12
|
+
}> {
|
|
13
|
+
private readonly tracks;
|
|
14
|
+
private subhook;
|
|
15
|
+
private callbacks;
|
|
16
|
+
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook: Subscribehook, callbacks: AsyncCommandCallback, state?: RCLinkedListPoint);
|
|
17
|
+
execute(store: Store, invoker: Invoker): Promise<{
|
|
18
|
+
code: RCRTCCode;
|
|
19
|
+
failedList?: ISubscribeAttr[];
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* 如果当前节点的状态为 MIDDLE,则返回 store 的订阅属性列表。否则,返回存储的订阅属性列表
|
|
23
|
+
* @param {Store} store
|
|
24
|
+
* @returns ISubscribeAttr 对象的数组。
|
|
25
|
+
*/
|
|
26
|
+
private getSubscribedList;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AsyncSubscribeCommand.d.ts.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { RCLinkedListPoint } from '../enums/RCLinkedListPoint';
|
|
2
|
+
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
3
|
+
import { ISubscribeAttr } from '../interfaces';
|
|
4
|
+
import { Invoker } from '../Invoker';
|
|
5
|
+
import { Store } from '../Store';
|
|
6
|
+
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
7
|
+
import { AsyncCommand, AsyncCommandCallback } from './AsyncCommand';
|
|
8
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
9
|
+
export declare class AsyncUnsubscribeCommand extends AsyncCommand<{
|
|
10
|
+
code: RCRTCCode;
|
|
11
|
+
failedList?: ISubscribeAttr[];
|
|
12
|
+
}> {
|
|
13
|
+
private tracks;
|
|
14
|
+
private subhook;
|
|
15
|
+
private callbacks;
|
|
16
|
+
constructor(tracks: RCRemoteTrack[], subhook: Subscribehook, callbacks: AsyncCommandCallback, state?: RCLinkedListPoint);
|
|
17
|
+
execute(store: Store, invoker: Invoker): Promise<{
|
|
18
|
+
code: RCRTCCode;
|
|
19
|
+
failedList?: ISubscribeAttr[];
|
|
20
|
+
}>;
|
|
21
|
+
/**
|
|
22
|
+
* 如果当前节点的状态为 MIDDLE,则返回 store 的订阅属性列表。否则,返回存储的订阅属性列表
|
|
23
|
+
* @param {Store} store
|
|
24
|
+
* @returns ISubscribeAttr 对象的数组。
|
|
25
|
+
*/
|
|
26
|
+
private getSubscribedList;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=AsyncUnsubscribeCommand.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RCLinkedListPoint } from '../enums/RCLinkedListPoint';
|
|
2
|
+
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
3
|
+
import { ISubscribeAttr } from '../interfaces';
|
|
4
|
+
import { Invoker } from '../Invoker';
|
|
5
|
+
import { Store } from '../Store';
|
|
6
|
+
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
7
|
+
import { AsyncCommand, AsyncCommandCallback } from './AsyncCommand';
|
|
8
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
9
|
+
/**
|
|
10
|
+
* 更新订阅关系,为强制更新订阅关系,传入的 Tracks 都会被订阅
|
|
11
|
+
*/
|
|
12
|
+
export declare class AsyncUpdateSubscribeListCommand extends AsyncCommand<{
|
|
13
|
+
code: RCRTCCode;
|
|
14
|
+
failedList?: ISubscribeAttr[];
|
|
15
|
+
}> {
|
|
16
|
+
private readonly tracks;
|
|
17
|
+
private subhook;
|
|
18
|
+
private callbacks;
|
|
19
|
+
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook: Subscribehook, callbacks: AsyncCommandCallback, state?: RCLinkedListPoint);
|
|
20
|
+
execute(store: Store, invoker: Invoker): Promise<{
|
|
21
|
+
code: RCRTCCode;
|
|
22
|
+
failedList?: ISubscribeAttr[];
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=AsyncUpdateSubscribeListCommand.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
1
2
|
import { BaseInvoker } from '../Invoker';
|
|
2
3
|
import { Store } from '../Store';
|
|
3
4
|
export declare enum CommandPriority {
|
|
@@ -5,6 +6,9 @@ export declare enum CommandPriority {
|
|
|
5
6
|
NORMAL = 1,
|
|
6
7
|
HIGH = 2
|
|
7
8
|
}
|
|
9
|
+
export declare enum CommandCode {
|
|
10
|
+
Destroy = 40400
|
|
11
|
+
}
|
|
8
12
|
/**
|
|
9
13
|
* 命令基类
|
|
10
14
|
*/
|
|
@@ -18,5 +22,10 @@ export declare abstract class BaseCommand<RES, STORE = Store> {
|
|
|
18
22
|
* 获取指令优先级,必要时可 override 此函数
|
|
19
23
|
*/
|
|
20
24
|
get priority(): CommandPriority;
|
|
25
|
+
/**
|
|
26
|
+
* 它返回命令的种类。
|
|
27
|
+
* @returns 命令的种类。
|
|
28
|
+
*/
|
|
29
|
+
get kind(): RCCommandKind;
|
|
21
30
|
}
|
|
22
31
|
//# sourceMappingURL=BaseCommand.d.ts.map
|
|
@@ -4,6 +4,7 @@ import { Store } from '../Store';
|
|
|
4
4
|
import { ErrorCode, IJoinRTCRoomData, IRTCUserData, RTCJoinType, RTCMode } from '@rongcloud/engine';
|
|
5
5
|
import { RCLivingType } from '../enums/RCLivingType';
|
|
6
6
|
import { Invoker } from '../Invoker';
|
|
7
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
7
8
|
/**
|
|
8
9
|
* 资源发布命令
|
|
9
10
|
*/
|
|
@@ -18,6 +19,7 @@ export declare class JoinRoomCommand extends BaseCommand<{
|
|
|
18
19
|
private readonly innerUserDatas?;
|
|
19
20
|
private readonly outerUserDatas?;
|
|
20
21
|
constructor(roomId: string, roomType: RTCMode, joinType?: RTCJoinType | undefined, livingType?: RCLivingType | undefined, innerUserDatas?: IRTCUserData | undefined, outerUserDatas?: IRTCUserData | undefined);
|
|
22
|
+
get kind(): RCCommandKind;
|
|
21
23
|
execute(store: Store, invoker: Invoker): Promise<{
|
|
22
24
|
code: ErrorCode | RCRTCCode;
|
|
23
25
|
data?: IJoinRTCRoomData;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
1
2
|
import { RCRTCCode } from '../enums/RCRTCCode';
|
|
2
3
|
import { IPKInfo } from '../interfaces';
|
|
3
4
|
import { Invoker } from '../Invoker';
|
|
@@ -18,6 +19,7 @@ export declare class LeaveOtherRoomCommand extends BaseCommand<{
|
|
|
18
19
|
constructor(pkHandler: RCLivingPKHandler, room: RCLivingRoom, _PKInfo: IPKInfo, hooks: ExchangeHooks, _joinedPKRooms: {
|
|
19
20
|
[roomId: string]: RCLivingRoom;
|
|
20
21
|
}, isQuitPK?: boolean | undefined);
|
|
22
|
+
get kind(): RCCommandKind;
|
|
21
23
|
/**
|
|
22
24
|
* 结束跨房间连麦
|
|
23
25
|
* @param roomId 需要结束连麦的房间 roomId
|
|
@@ -2,12 +2,12 @@ import { Invoker } from '../Invoker';
|
|
|
2
2
|
import { Store } from '../Store';
|
|
3
3
|
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
4
4
|
import { BaseCommand } from './BaseCommand';
|
|
5
|
-
import {
|
|
5
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
6
6
|
export declare class OnRemoteUserUnpubCommand extends BaseCommand<void> {
|
|
7
7
|
private subhook;
|
|
8
8
|
private tracks;
|
|
9
9
|
private onTrackUnpublish;
|
|
10
|
-
constructor(subhook:
|
|
10
|
+
constructor(subhook: Subscribehook, tracks: RCRemoteTrack[], onTrackUnpublish: (tracks: RCRemoteTrack[]) => void);
|
|
11
11
|
execute(store: Store, invoker: Invoker): Promise<void>;
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=OnRemoteUserUnpubCommand.d.ts.map
|
|
@@ -4,7 +4,7 @@ import { Invoker } from '../Invoker';
|
|
|
4
4
|
import { Store } from '../Store';
|
|
5
5
|
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from '../tracks/RCRemoteTrack';
|
|
6
6
|
import { BaseCommand, CommandPriority } from './BaseCommand';
|
|
7
|
-
import {
|
|
7
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
8
8
|
export declare type ReconnectedCommandCallback = {
|
|
9
9
|
onPeerClosed: () => void;
|
|
10
10
|
onUserJoin: (userIds: string[]) => void;
|
|
@@ -21,7 +21,7 @@ export declare class OnSignalReconnectedCommand extends BaseCommand<{
|
|
|
21
21
|
private subhook;
|
|
22
22
|
private callbacks;
|
|
23
23
|
private livingType?;
|
|
24
|
-
constructor(subhook:
|
|
24
|
+
constructor(subhook: Subscribehook, callbacks: ReconnectedCommandCallback, livingType?: RCLivingType | undefined);
|
|
25
25
|
/**
|
|
26
26
|
* @override
|
|
27
27
|
*/
|
|
@@ -5,7 +5,7 @@ import { ICDNUris } from '../service';
|
|
|
5
5
|
import { Store } from '../Store';
|
|
6
6
|
import { RCRemoteAudioTrack, RCRemoteTrack, RCRemoteVideoTrack } from '../tracks/RCRemoteTrack';
|
|
7
7
|
import { BaseCommand, CommandPriority } from './BaseCommand';
|
|
8
|
-
import {
|
|
8
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
9
9
|
export declare type ResourceMsgContent = {
|
|
10
10
|
/**
|
|
11
11
|
* 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
|
|
@@ -25,7 +25,7 @@ export declare class ParseRemoteResCommand extends BaseCommand<void> {
|
|
|
25
25
|
private senderId;
|
|
26
26
|
private subhook;
|
|
27
27
|
private callback;
|
|
28
|
-
constructor(msgContent: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, senderId: string, subhook:
|
|
28
|
+
constructor(msgContent: ResourceMsgContent, messageType: RCRTCMessageType.PUBLISH | RCRTCMessageType.UNPUBLISH | RCRTCMessageType.MODIFY | RCRTCMessageType.TOTAL_CONTENT_RESOURCE, senderId: string, subhook: Subscribehook, callback: {
|
|
29
29
|
onTrackPublish: (tracks: RCRemoteTrack[]) => void;
|
|
30
30
|
onTrackUnublish: (tracks: RCRemoteTrack[]) => void;
|
|
31
31
|
onAudioMute: (track: RCRemoteAudioTrack) => void;
|
|
@@ -2,7 +2,7 @@ import { RCRTCLiveRole } from '../enums/RCRTCLiveRole';
|
|
|
2
2
|
import { Invoker } from '../Invoker';
|
|
3
3
|
import { Store } from '../Store';
|
|
4
4
|
import { BaseCommand, CommandPriority } from './BaseCommand';
|
|
5
|
-
import {
|
|
5
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
6
6
|
declare type StateMsgContent = {
|
|
7
7
|
users: {
|
|
8
8
|
userId: string;
|
|
@@ -49,7 +49,7 @@ export interface IParseUserStateRes {
|
|
|
49
49
|
export declare class ParseUserStateCommand extends BaseCommand<IParseUserStateRes> {
|
|
50
50
|
private msgContent;
|
|
51
51
|
private subhook;
|
|
52
|
-
constructor(msgContent: StateMsgContent, subhook:
|
|
52
|
+
constructor(msgContent: StateMsgContent, subhook: Subscribehook);
|
|
53
53
|
get priority(): CommandPriority;
|
|
54
54
|
execute(store: Store, invoker: Invoker): Promise<IParseUserStateRes>;
|
|
55
55
|
}
|
|
@@ -4,6 +4,7 @@ import { Store } from '../Store';
|
|
|
4
4
|
import { RCLocalTrack } from '../tracks/RCLocalTrack';
|
|
5
5
|
import { IPushOtherRooms, IRTCReqHeader } from '../service';
|
|
6
6
|
import { Invoker } from '../Invoker';
|
|
7
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
7
8
|
export declare type PubhookPeerItem = IMutilPeerC & {
|
|
8
9
|
headers: IRTCReqHeader;
|
|
9
10
|
};
|
|
@@ -15,10 +16,11 @@ export declare type Pubhook = (tracks: (RCLocalTrack | IPublishAttrs)[]) => Pubh
|
|
|
15
16
|
/**
|
|
16
17
|
* 资源发布命令
|
|
17
18
|
*/
|
|
18
|
-
export declare class
|
|
19
|
+
export declare class PublishCommand extends BaseCommand<IPubSuccessRes> {
|
|
19
20
|
private tracks;
|
|
20
21
|
private pubhook;
|
|
21
22
|
constructor(tracks: (RCLocalTrack | IPublishAttrs)[], pubhook: Pubhook);
|
|
23
|
+
get kind(): RCCommandKind;
|
|
22
24
|
/**
|
|
23
25
|
* 从 pc 移除当次发布失败的资源
|
|
24
26
|
*/
|
|
@@ -31,4 +33,4 @@ export declare class PubCommand extends BaseCommand<IPubSuccessRes> {
|
|
|
31
33
|
private _mergePublishRes;
|
|
32
34
|
execute(store: Store, invoker: Invoker): Promise<IPubSuccessRes>;
|
|
33
35
|
}
|
|
34
|
-
//# sourceMappingURL=
|
|
36
|
+
//# sourceMappingURL=PublishCommand.d.ts.map
|
|
@@ -4,18 +4,18 @@ import { Invoker } from '../Invoker';
|
|
|
4
4
|
import { Store } from '../Store';
|
|
5
5
|
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
6
6
|
import { BaseCommand } from './BaseCommand';
|
|
7
|
-
import {
|
|
8
|
-
export declare class
|
|
7
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
8
|
+
export declare class SubscribeCommand extends BaseCommand<{
|
|
9
9
|
code: RCRTCCode;
|
|
10
10
|
failedList?: ISubscribeAttr[];
|
|
11
11
|
}> {
|
|
12
12
|
private readonly tracks;
|
|
13
13
|
private subhook;
|
|
14
14
|
private readonly forceReq?;
|
|
15
|
-
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook:
|
|
15
|
+
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook: Subscribehook, forceReq?: boolean | undefined);
|
|
16
16
|
execute(store: Store, invoker: Invoker): Promise<{
|
|
17
17
|
code: RCRTCCode;
|
|
18
18
|
failedList?: ISubscribeAttr[];
|
|
19
19
|
}>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=
|
|
21
|
+
//# sourceMappingURL=SubscribeCommand.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RCCommandKind } from '../enums/RCCommandKind';
|
|
1
2
|
import { IPublishAttrs, IPubSuccessRes } from '../interfaces';
|
|
2
3
|
import { Invoker } from '../Invoker';
|
|
3
4
|
import { IPushOtherRooms, IRTCReqHeader } from '../service/interface';
|
|
@@ -9,12 +10,13 @@ export declare type UnpubhookRes = {
|
|
|
9
10
|
headers: IRTCReqHeader;
|
|
10
11
|
};
|
|
11
12
|
export declare type Unpubhook = (tracks: (RCLocalTrack | IPublishAttrs)[], pcName: string) => UnpubhookRes;
|
|
12
|
-
export declare class
|
|
13
|
+
export declare class UnpublishCommand extends BaseCommand<IPubSuccessRes> {
|
|
13
14
|
private tracks;
|
|
14
15
|
private unpubhook;
|
|
15
16
|
constructor(tracks: RCLocalTrack[], unpubhook: Unpubhook);
|
|
17
|
+
get kind(): RCCommandKind;
|
|
16
18
|
private __unpublish;
|
|
17
19
|
private _mergeUnpublishRes;
|
|
18
20
|
execute(store: Store, invoker: Invoker): Promise<IPubSuccessRes>;
|
|
19
21
|
}
|
|
20
|
-
//# sourceMappingURL=
|
|
22
|
+
//# sourceMappingURL=UnpublishCommand.d.ts.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Store } from '../Store';
|
|
2
|
+
import { BaseCommand } from './BaseCommand';
|
|
3
|
+
/**
|
|
4
|
+
* 加入房间后,若房间中已存在己方发布的资源,表示之前未能完成正常退出流程
|
|
5
|
+
* 需先清除房间内的己方资源,通知房间内其他人己方已取消当前资源的发布
|
|
6
|
+
* 该步骤没有必要与 MediaServer 的交互,因后续资源变更交互为全量交互
|
|
7
|
+
*/
|
|
8
|
+
export declare class UnpublishPrevCommand extends BaseCommand<void> {
|
|
9
|
+
execute(store: Store): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=UnpublishPrevCommand.d.ts.map
|
|
@@ -4,17 +4,17 @@ import { Invoker } from '../Invoker';
|
|
|
4
4
|
import { Store } from '../Store';
|
|
5
5
|
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
6
6
|
import { BaseCommand } from './BaseCommand';
|
|
7
|
-
import {
|
|
8
|
-
export declare class
|
|
7
|
+
import { Subscribehook } from './UpdateSubscribeListCommand';
|
|
8
|
+
export declare class UnsubscribeCommand extends BaseCommand<{
|
|
9
9
|
code: RCRTCCode;
|
|
10
10
|
failedList?: ISubscribeAttr[];
|
|
11
11
|
}> {
|
|
12
12
|
private tracks;
|
|
13
13
|
private subhook;
|
|
14
|
-
constructor(tracks: RCRemoteTrack[], subhook:
|
|
14
|
+
constructor(tracks: RCRemoteTrack[], subhook: Subscribehook);
|
|
15
15
|
execute(store: Store, invoker: Invoker): Promise<{
|
|
16
16
|
code: RCRTCCode;
|
|
17
17
|
failedList?: ISubscribeAttr[];
|
|
18
18
|
}>;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=UnsubscribeCommand.d.ts.map
|
|
@@ -6,23 +6,23 @@ import { Store } from '../Store';
|
|
|
6
6
|
import { RCRemoteTrack } from '../tracks/RCRemoteTrack';
|
|
7
7
|
import RCRTCPeerConnection from '../webrtc/RCRTCPeerConnection';
|
|
8
8
|
import { BaseCommand } from './BaseCommand';
|
|
9
|
-
export declare type
|
|
9
|
+
export declare type SubscribehookRes = {
|
|
10
10
|
pc: RCRTCPeerConnection;
|
|
11
11
|
pushOtherRooms: IPushOtherRooms[];
|
|
12
12
|
headers: IRTCReqHeader;
|
|
13
13
|
};
|
|
14
|
-
export declare type
|
|
15
|
-
export declare class
|
|
14
|
+
export declare type Subscribehook = (tracks: (RCRemoteTrack | ISubscribeAttr)[]) => SubscribehookRes;
|
|
15
|
+
export declare class UpdateSubscribeListCommand extends BaseCommand<{
|
|
16
16
|
code: RCRTCCode;
|
|
17
17
|
failedList?: ISubscribeAttr[];
|
|
18
18
|
}> {
|
|
19
19
|
private readonly tracks;
|
|
20
20
|
private subhook;
|
|
21
21
|
private readonly forceReq?;
|
|
22
|
-
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook:
|
|
22
|
+
constructor(tracks: (RCRemoteTrack | ISubscribeAttr)[], subhook: Subscribehook, forceReq?: boolean | undefined);
|
|
23
23
|
execute(store: Store, invoker: Invoker): Promise<{
|
|
24
24
|
code: RCRTCCode;
|
|
25
25
|
failedList?: ISubscribeAttr[];
|
|
26
26
|
}>;
|
|
27
27
|
}
|
|
28
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=UpdateSubscribeListCommand.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum RCCommandKind {
|
|
2
|
+
Unknow = 0,
|
|
3
|
+
Publish = 1,
|
|
4
|
+
UnPublish = 2,
|
|
5
|
+
JoinRoom = 3,
|
|
6
|
+
LeaveRoom = 4,
|
|
7
|
+
UpdateSubscribeTask = 5,
|
|
8
|
+
SubscribedTask = 6,
|
|
9
|
+
UnSubscribedTask = 7,
|
|
10
|
+
AsyncCommand = "AsyncCommand"
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=RCCommandKind.d.ts.map
|
|
@@ -606,7 +606,19 @@ export declare enum RCLoggerTag {
|
|
|
606
606
|
/**
|
|
607
607
|
* 设置 SDP 上的码率
|
|
608
608
|
*/
|
|
609
|
-
L_RTC_SDP_BITRATE_O = "L_rtc_sdp_bitrate_O"
|
|
609
|
+
L_RTC_SDP_BITRATE_O = "L_rtc_sdp_bitrate_O",
|
|
610
|
+
/**
|
|
611
|
+
* 3A 降噪
|
|
612
|
+
*/
|
|
613
|
+
L_RTC_3ANOISE_NODE_O = "L_RTC_AAAnoiseNode_O",
|
|
614
|
+
/**
|
|
615
|
+
* 3A 降噪
|
|
616
|
+
*/
|
|
617
|
+
L_RTC_3ANOISE_NODE_E = "L_RTC_AAAnoiseNode_E",
|
|
618
|
+
/**
|
|
619
|
+
* 3A 降噪
|
|
620
|
+
*/
|
|
621
|
+
L_RTC_3ANOISE_NODE_STOP_O = "L_RTC_AAAnoiseNode_Stop_O"
|
|
610
622
|
}
|
|
611
623
|
export declare enum RCLoggerStatus {
|
|
612
624
|
/**
|
|
@@ -61,6 +61,10 @@ export declare enum RCRTCMessageType {
|
|
|
61
61
|
/**
|
|
62
62
|
* 连麦的房间不再了或离线了,主直播房间会收到的消息通知
|
|
63
63
|
*/
|
|
64
|
-
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline"
|
|
64
|
+
OTHER_ROOM_OFFLINE = "RCRTC:otherRoomOffline",
|
|
65
|
+
/**
|
|
66
|
+
* 订阅、取消订阅动作成功
|
|
67
|
+
*/
|
|
68
|
+
ROOM_TASK_FINISH = "RCRTC:roomTaskFinish"
|
|
65
69
|
}
|
|
66
70
|
//# sourceMappingURL=RCRTCMessageType.d.ts.map
|
|
@@ -577,6 +577,14 @@ export interface IRoomEventListener extends IRCRTCTrackEventListener {
|
|
|
577
577
|
* 主播和观众切换身份通知
|
|
578
578
|
*/
|
|
579
579
|
onSwitchRole?(userId: string, role: RCRTCLiveRole): void;
|
|
580
|
+
/**
|
|
581
|
+
* 房间任务完成时调用的函数。
|
|
582
|
+
* @param code 任务完成后的状态
|
|
583
|
+
* @param subscribe 订阅成功的列表
|
|
584
|
+
* @param unsubscribe 取消订阅成功的列表
|
|
585
|
+
* @param failedList 订阅失败的列表
|
|
586
|
+
*/
|
|
587
|
+
onTaskCompleted?(code: RCRTCCode, subscribe: ISubscribeAttr[], unsubscribe: ISubscribeAttr[], failedList: ISubscribeAttr[]): void;
|
|
580
588
|
}
|
|
581
589
|
/**
|
|
582
590
|
* RTCClient 初始化配置
|
|
@@ -624,6 +632,17 @@ export interface IRCRTCInitOptions {
|
|
|
624
632
|
* 观众拉内置 CDN 资源时是否使用 https,默认为 RCInnerCDNPullIsHttps.HTTPS
|
|
625
633
|
*/
|
|
626
634
|
pullInnerCDNUseHttps?: RCInnerCDNPullIsHttps;
|
|
635
|
+
/**
|
|
636
|
+
* 音频降噪处理
|
|
637
|
+
* - workletModule 默认值为 https://cdn.ronghub.com/plugin-rtc/wasm/5.0.0-alpha.1/process-worklet.js
|
|
638
|
+
* - workletWasm 默认值为 https://cdn.ronghub.com/plugin-rtc/wasm/5.0.0-alpha.1/AudioProcessing.wasm
|
|
639
|
+
* - isOpen 默认值为 false
|
|
640
|
+
*/
|
|
641
|
+
audio?: {
|
|
642
|
+
workletModule?: string;
|
|
643
|
+
workletWasm?: string;
|
|
644
|
+
isOpen?: boolean;
|
|
645
|
+
};
|
|
627
646
|
}
|
|
628
647
|
export interface ICameraVideoProfile extends IVideoProfile {
|
|
629
648
|
cameraId?: string;
|
|
@@ -250,6 +250,12 @@ export default abstract class RCAbstractRoom extends EventEmitter {
|
|
|
250
250
|
code: RCRTCCode;
|
|
251
251
|
failedList?: ISubscribeAttr[];
|
|
252
252
|
}>;
|
|
253
|
+
/**
|
|
254
|
+
* 它将订阅任务添加到队列中。
|
|
255
|
+
* @param {(RCRemoteTrack | ISubscribeAttr)[]} tracks - (RCRemoteTrack | ISubscribeAttr)[]
|
|
256
|
+
* @returns 一个用代码和失败列表解析为对象的承诺。
|
|
257
|
+
*/
|
|
258
|
+
addSubscribeTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): void;
|
|
253
259
|
/**
|
|
254
260
|
* 取消订阅资源
|
|
255
261
|
* @param tracks 预取消远端资源
|
|
@@ -258,6 +264,27 @@ export default abstract class RCAbstractRoom extends EventEmitter {
|
|
|
258
264
|
code: RCRTCCode;
|
|
259
265
|
failedList?: ISubscribeAttr[];
|
|
260
266
|
}>;
|
|
267
|
+
/**
|
|
268
|
+
* 它将取消订阅任务添加到队列中。
|
|
269
|
+
* @param {RCRemoteTrack[]} tracks - 要取消订阅的曲目。
|
|
270
|
+
* @returns 一个用代码和失败列表解析为对象的承诺。
|
|
271
|
+
*/
|
|
272
|
+
addUnsubscribeTask(tracks: RCRemoteTrack[]): void;
|
|
273
|
+
/**
|
|
274
|
+
* 强制修改订阅列表,仅订阅数组中的资源,取消订阅其他已订阅资源。
|
|
275
|
+
* 当参数为 `[]` 时,意味着不再订阅任何资源
|
|
276
|
+
* @param tracks 变更的资源列表
|
|
277
|
+
*/
|
|
278
|
+
updateSubList(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
279
|
+
code: RCRTCCode;
|
|
280
|
+
failedList?: ISubscribeAttr[];
|
|
281
|
+
}>;
|
|
282
|
+
/**
|
|
283
|
+
* 将任务添加到任务队列的函数。
|
|
284
|
+
* @param {(RCRemoteTrack | ISubscribeAttr)[]} tracks - (RCRemoteTrack | ISubscribeAttr)[]
|
|
285
|
+
*/
|
|
286
|
+
addUpdateSubscribeListTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): void;
|
|
287
|
+
private _onTaskCompleted;
|
|
261
288
|
/**
|
|
262
289
|
* 获取已发布的本地资源
|
|
263
290
|
* @param trackId
|
|
@@ -275,14 +302,10 @@ export default abstract class RCAbstractRoom extends EventEmitter {
|
|
|
275
302
|
*/
|
|
276
303
|
getRemoteTrack(trackId: string): RCRemoteTrack | null;
|
|
277
304
|
/**
|
|
278
|
-
*
|
|
279
|
-
*
|
|
280
|
-
* @param tracks 变更的资源列表
|
|
305
|
+
* 获取当前已经订阅的全量资源
|
|
306
|
+
* returns subscribedTracks ISubscribeAttr[]
|
|
281
307
|
*/
|
|
282
|
-
|
|
283
|
-
code: RCRTCCode;
|
|
284
|
-
failedList?: ISubscribeAttr[];
|
|
285
|
-
}>;
|
|
308
|
+
get subscribedTracks(): ISubscribeAttr[];
|
|
286
309
|
private _appListener;
|
|
287
310
|
/**
|
|
288
311
|
* 注册事件监听器,多次注册会导致后者覆盖前者,可以通过使用 `registerRoomEventListener(null)` 取消注册
|
|
@@ -221,6 +221,10 @@ export default class RCAudienceLivingRoom {
|
|
|
221
221
|
code: RCRTCCode;
|
|
222
222
|
failedList?: ISubscribeAttr[];
|
|
223
223
|
}>;
|
|
224
|
+
addSubscribeTask(tracks: (RCRemoteTrack | ISubscribeAttr)[]): Promise<{
|
|
225
|
+
code: RCRTCCode;
|
|
226
|
+
failedList?: ISubscribeAttr[];
|
|
227
|
+
}>;
|
|
224
228
|
private __unsubscribe;
|
|
225
229
|
/**
|
|
226
230
|
* 取消订阅资源
|
|
@@ -230,6 +234,10 @@ export default class RCAudienceLivingRoom {
|
|
|
230
234
|
code: RCRTCCode;
|
|
231
235
|
failedList?: ISubscribeAttr[];
|
|
232
236
|
}>;
|
|
237
|
+
addUnsubscribeTask(tracks: RCRemoteTrack[]): Promise<{
|
|
238
|
+
code: RCRTCCode;
|
|
239
|
+
failedList?: ISubscribeAttr[];
|
|
240
|
+
}>;
|
|
233
241
|
/**
|
|
234
242
|
* 退出房间并销毁当前房间实例,退出后该房间的所有方法将不可用
|
|
235
243
|
*/
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export default class RC3AnoiseTrack {
|
|
2
|
+
static workletModule: string;
|
|
3
|
+
static workletWasm: string;
|
|
4
|
+
static isOpen: boolean;
|
|
5
|
+
/**
|
|
6
|
+
* 该函数接受一个布尔值作为参数,如果没有传递参数,该函数将默认为 true
|
|
7
|
+
* @param {boolean} [isOpen=true] - 轨道是否开放。
|
|
8
|
+
*/
|
|
9
|
+
static setStatus(isOpen?: boolean): void;
|
|
10
|
+
/**
|
|
11
|
+
* 它设置 worklet 模块和 wasm。
|
|
12
|
+
* @param {string} module - 将用于创建工作集的模块的名称。
|
|
13
|
+
* @param {string} wasm - Rust 编译器生成的 wasm 文件。
|
|
14
|
+
*/
|
|
15
|
+
static setWroklet(module: string, wasm: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* 它创建一个 AudioContext,从输入流创建一个 MediaStreamSource,
|
|
18
|
+
* 创建一个 MediaStreamDestination,创建一个 AudioWorkletNode,并将节点连接在一起。
|
|
19
|
+
* @param {MediaStream} audioStream - 媒体流
|
|
20
|
+
* @returns 一个媒体流对象。
|
|
21
|
+
*/
|
|
22
|
+
static transformStreamTrack(audioStream: MediaStream): Promise<{
|
|
23
|
+
track: MediaStreamTrack;
|
|
24
|
+
stop: Function;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=RC3AnoiseTrack.d.ts.map
|