quickvo-sdk-js 1.6.55 → 1.6.56
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/package.json +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -26189
- package/dist/index.umd.cjs +0 -4
- package/dist/src/QuickVO.d.ts +0 -86
- package/dist/src/action/ActionBase.d.ts +0 -10
- package/dist/src/action/ActionP2P.d.ts +0 -14
- package/dist/src/action/ActionSFU.d.ts +0 -133
- package/dist/src/base/Base.d.ts +0 -59
- package/dist/src/base/modules/AnimationFrame.d.ts +0 -22
- package/dist/src/base/modules/Config.d.ts +0 -130
- package/dist/src/base/modules/LocalMedias.d.ts +0 -96
- package/dist/src/base/modules/Notifys.d.ts +0 -41
- package/dist/src/base/modules/Peer.d.ts +0 -48
- package/dist/src/base/modules/PrResolves.d.ts +0 -23
- package/dist/src/base/modules/StreamRecorder.d.ts +0 -40
- package/dist/src/base/modules/Traffic.d.ts +0 -21
- package/dist/src/base/modules/cws/CallsWebSocket.d.ts +0 -48
- package/dist/src/base/modules/cws/CallsWebSocketEvent.d.ts +0 -36
- package/dist/src/base/modules/cws/PrWebSocket.d.ts +0 -49
- package/dist/src/base/modules/cws/filterData.d.ts +0 -17
- package/dist/src/base/modules/users/Users.d.ts +0 -203
- package/dist/src/base/modules/users/modules/LocalTrackAnalysis.d.ts +0 -20
- package/dist/src/base/modules/users/modules/LocalUser.d.ts +0 -33
- package/dist/src/base/modules/users/modules/RemotePeerTrackAnalysis.d.ts +0 -20
- package/dist/src/base/modules/users/modules/RemoteUser.d.ts +0 -75
- package/dist/src/base/modules/users/modules/RemoteUserP2P.d.ts +0 -87
- package/dist/src/base/modules/users/modules/UserBase.d.ts +0 -173
- package/dist/src/enums/callStrategy.d.ts +0 -14
- package/dist/src/enums/eventName.d.ts +0 -38
- package/dist/src/enums/index.d.ts +0 -7
- package/dist/src/enums/mediaType.d.ts +0 -15
- package/dist/src/enums/notifyName.d.ts +0 -30
- package/dist/src/enums/quality.d.ts +0 -17
- package/dist/src/enums/roomState.d.ts +0 -17
- package/dist/src/enums/trackType.d.ts +0 -15
- package/dist/src/index.d.ts +0 -3
- package/dist/src/protos/compiled.d.ts +0 -7175
- package/dist/src/protos/index.d.ts +0 -1
- package/dist/src/protos/protoEvent.d.ts +0 -196
- package/dist/src/tools.d.ts +0 -5
- package/dist/src/types.d.ts +0 -278
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export declare class StreamRecorder {
|
|
2
|
-
#private;
|
|
3
|
-
onchange: (_e: any) => void;
|
|
4
|
-
onDurationChange: (_e: number) => void;
|
|
5
|
-
constructor();
|
|
6
|
-
/**
|
|
7
|
-
* start
|
|
8
|
-
*/
|
|
9
|
-
start: (fileName?: string) => Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* pause
|
|
12
|
-
*/
|
|
13
|
-
pause: () => Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* resume
|
|
16
|
-
*/
|
|
17
|
-
resume: () => Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* stop
|
|
20
|
-
*/
|
|
21
|
-
stop: () => Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* 清理资源:清除定时器,若正在录制则先停止。实例丢弃前应调用 destroy 或 stop,避免定时器泄漏。
|
|
24
|
-
*/
|
|
25
|
-
destroy: () => void;
|
|
26
|
-
/**
|
|
27
|
-
* getDuration
|
|
28
|
-
*/
|
|
29
|
-
getDuration: () => number;
|
|
30
|
-
/**
|
|
31
|
-
* getInfo
|
|
32
|
-
*/
|
|
33
|
-
getInfo: () => {
|
|
34
|
-
active: boolean;
|
|
35
|
-
pause: boolean;
|
|
36
|
-
startTime: number;
|
|
37
|
-
endTime: number;
|
|
38
|
-
duration: number;
|
|
39
|
-
};
|
|
40
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export declare class Traffic {
|
|
2
|
-
sfu: {
|
|
3
|
-
outboundBytes: number;
|
|
4
|
-
inboundBytes: number;
|
|
5
|
-
};
|
|
6
|
-
p2p: {
|
|
7
|
-
outboundBytes: number;
|
|
8
|
-
inboundBytes: number;
|
|
9
|
-
};
|
|
10
|
-
getUse: (unit?: "b" | "kb") => {
|
|
11
|
-
sfu: {
|
|
12
|
-
outboundBytes: number;
|
|
13
|
-
inboundBytes: number;
|
|
14
|
-
};
|
|
15
|
-
p2p: {
|
|
16
|
-
outboundBytes: number;
|
|
17
|
-
inboundBytes: number;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
clear: () => void;
|
|
21
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { K_notifyName } from '../../../enums/notifyName';
|
|
2
|
-
import { K_eventName } from '../../../enums/eventName';
|
|
3
|
-
import { CallsWebSocketEvent, Options } from './CallsWebSocketEvent';
|
|
4
|
-
import { Config } from '../Config';
|
|
5
|
-
import { PrWebSocket } from './PrWebSocket';
|
|
6
|
-
export interface CallsWebSocketOptions {
|
|
7
|
-
/**
|
|
8
|
-
* websocket服务地址
|
|
9
|
-
*/
|
|
10
|
-
url?: string;
|
|
11
|
-
/**
|
|
12
|
-
* 超时时间
|
|
13
|
-
*/
|
|
14
|
-
timeout?: number;
|
|
15
|
-
/**
|
|
16
|
-
* 开启后会在控制台显示相关操作日志 默认为false
|
|
17
|
-
*/
|
|
18
|
-
debug?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare class CallsWebSocket {
|
|
21
|
-
config: Config;
|
|
22
|
-
timeout: number;
|
|
23
|
-
prws: PrWebSocket;
|
|
24
|
-
events: Map<"answer" | "offer" | "heartbeat" | "heartbeatEx" | "ackMsg" | "reportNetwork" | "connectCF" | "publish" | "joinRoom" | "joinRoomEx" | "pubNotify" | "subscribe" | "renegotiate" | "closeTrack" | "preventUsersBehavior" | "networkQualityChange" | "updateCall" | "toggleRoomSpeechLang" | "syncRoomInfo" | "updateRoomToken" | "candidate" | "reportP2PConnectEx" | "quitRoom" | "quitRoomEx" | "debugger" | "ai" | "UpdateTrackActive", CallsWebSocketEvent<any>>;
|
|
25
|
-
on: {
|
|
26
|
-
[key in K_notifyName]?: Function;
|
|
27
|
-
} & {
|
|
28
|
-
close?: (e: any) => void;
|
|
29
|
-
open?: (e: any) => void;
|
|
30
|
-
log?: (e: any) => void;
|
|
31
|
-
};
|
|
32
|
-
/** 日志写入节流:内存缓冲,避免每条消息都读写 localStorage */
|
|
33
|
-
private _logBuffer;
|
|
34
|
-
private _logFlushTimer;
|
|
35
|
-
private static _LOG_FLUSH_DELAY;
|
|
36
|
-
constructor({ config }: {
|
|
37
|
-
config: Config;
|
|
38
|
-
});
|
|
39
|
-
needRestoreRoom: () => boolean;
|
|
40
|
-
connect: (url: string) => Promise<void>;
|
|
41
|
-
close: () => void;
|
|
42
|
-
createRequest: <T extends K_eventName>(eventName: T, options?: Options) => CallsWebSocketEvent<T>;
|
|
43
|
-
hasEvent: (eventName: K_eventName) => boolean;
|
|
44
|
-
clearEvents: () => void;
|
|
45
|
-
retryEvents: () => Promise<void>;
|
|
46
|
-
private _updataLogs;
|
|
47
|
-
private _flushLogs;
|
|
48
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { K_eventName } from '../../../enums/eventName';
|
|
2
|
-
import { MessageReq, MessageRsp } from '../../../protos/protoEvent';
|
|
3
|
-
import { PrWebSocket } from './PrWebSocket';
|
|
4
|
-
export interface Options {
|
|
5
|
-
/**
|
|
6
|
-
* 超时时间 默认10s
|
|
7
|
-
*/
|
|
8
|
-
timeout?: number;
|
|
9
|
-
/**
|
|
10
|
-
* 是否监听返回
|
|
11
|
-
*/
|
|
12
|
-
onBack?: boolean;
|
|
13
|
-
}
|
|
14
|
-
export declare class CallsWebSocketEvent<T extends K_eventName> {
|
|
15
|
-
eventName: K_eventName;
|
|
16
|
-
prws: PrWebSocket;
|
|
17
|
-
message?: MessageReq<T>;
|
|
18
|
-
needRetry: boolean;
|
|
19
|
-
_resolve: (_value: Pick<MessageRsp<T>, "event" | "sn" | "data" | "code" | "desc">) => void;
|
|
20
|
-
_reject: (_reason?: any) => void;
|
|
21
|
-
sendBefore?: (_message: MessageReq<T>) => void;
|
|
22
|
-
sendAfter?: (_message: MessageReq<T>) => void;
|
|
23
|
-
options: {
|
|
24
|
-
timeout: number;
|
|
25
|
-
onBack: boolean;
|
|
26
|
-
};
|
|
27
|
-
timer: number;
|
|
28
|
-
constructor(eventName: T, prws: PrWebSocket, options?: Options);
|
|
29
|
-
resolve: (_value: MessageRsp<T>) => void;
|
|
30
|
-
reject: (_reason?: any) => void;
|
|
31
|
-
retry: () => void;
|
|
32
|
-
send: (req_message: Pick<MessageReq<T>, "data" | "compress" | "version" | "sn">) => Promise<Pick<MessageRsp<T>, "sn" | "event" | "data" | "code" | "desc">>;
|
|
33
|
-
private sendMsg;
|
|
34
|
-
private _createTimer;
|
|
35
|
-
destroy: () => void;
|
|
36
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
interface On {
|
|
2
|
-
/**
|
|
3
|
-
* 消息回调
|
|
4
|
-
* @description 接收当前WebSocket的所有消息
|
|
5
|
-
*/
|
|
6
|
-
message?: (_e: any) => void;
|
|
7
|
-
/**
|
|
8
|
-
* 连接成功
|
|
9
|
-
*/
|
|
10
|
-
open?: (elapsed: number) => void;
|
|
11
|
-
/**
|
|
12
|
-
* 连接错误
|
|
13
|
-
*/
|
|
14
|
-
error?: (e: any) => void;
|
|
15
|
-
/**
|
|
16
|
-
* 连接关闭
|
|
17
|
-
*/
|
|
18
|
-
close?: (e: any) => void;
|
|
19
|
-
}
|
|
20
|
-
export declare class PrWebSocket {
|
|
21
|
-
binaryType: BinaryType;
|
|
22
|
-
debug: boolean;
|
|
23
|
-
url: string;
|
|
24
|
-
activeTimeStamp: number;
|
|
25
|
-
reconnectCount: number;
|
|
26
|
-
ws?: WebSocket;
|
|
27
|
-
on: On;
|
|
28
|
-
constructor();
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param url 连接地址
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
connect: (url: string) => void;
|
|
35
|
-
/**
|
|
36
|
-
* 重新连接
|
|
37
|
-
*/
|
|
38
|
-
reconnect: () => void;
|
|
39
|
-
/**
|
|
40
|
-
* 发送消息
|
|
41
|
-
*/
|
|
42
|
-
send: (_data: string | ArrayBufferLike | Blob | ArrayBufferView) => void;
|
|
43
|
-
/**
|
|
44
|
-
* 关闭
|
|
45
|
-
*/
|
|
46
|
-
close: (code?: number, reason?: string) => void;
|
|
47
|
-
private _open;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 可递归过滤的 JSON 值类型
|
|
3
|
-
*/
|
|
4
|
-
type FilterableValue = string | number | boolean | null | undefined | FilterableValue[] | {
|
|
5
|
-
[key: string]: FilterableValue;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* 过滤敏感数据,返回新对象(递归处理多层嵌套)
|
|
9
|
-
* - key 为 'sdp' 或 'Sdp' 时,将值设为 ''
|
|
10
|
-
* - key 为 'id' 或 'userId' 且值长度 > 10 时,脱敏为 xxx****xxx(前3后3)
|
|
11
|
-
* - 嵌套对象和数组中的对象会递归处理
|
|
12
|
-
* @param obj 原始对象
|
|
13
|
-
* @returns 新对象,不修改原对象
|
|
14
|
-
*/
|
|
15
|
-
declare function filterData<T extends FilterableValue>(obj: T): T;
|
|
16
|
-
export { filterData };
|
|
17
|
-
export type { FilterableValue };
|
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { K_mediaType } from '../../../enums/mediaType';
|
|
2
|
-
import { RoomUser, UserMediaTypes } from '../../../types';
|
|
3
|
-
import { Config } from '../Config';
|
|
4
|
-
import { LocalMedias } from '../LocalMedias';
|
|
5
|
-
import { Notifys } from '../Notifys';
|
|
6
|
-
import { LocalUser } from './modules/LocalUser';
|
|
7
|
-
import { RemoteUser } from './modules/RemoteUser';
|
|
8
|
-
import { RemoteUserP2P } from './modules/RemoteUserP2P';
|
|
9
|
-
export declare class Users {
|
|
10
|
-
config: Config;
|
|
11
|
-
localMedias: LocalMedias;
|
|
12
|
-
notifys: Notifys;
|
|
13
|
-
localUser: LocalUser;
|
|
14
|
-
remoteUsers: Map<string, RemoteUser>;
|
|
15
|
-
constructor({ config, localMedias, notifys }: {
|
|
16
|
-
config: Config;
|
|
17
|
-
localMedias: LocalMedias;
|
|
18
|
-
notifys: Notifys;
|
|
19
|
-
});
|
|
20
|
-
/**
|
|
21
|
-
* getLocalUserTrackReports
|
|
22
|
-
* @param mediaType K_mediaType
|
|
23
|
-
*/
|
|
24
|
-
getLocalUserTrackReports: (mediaType: K_mediaType) => import('../../..').TrackReport;
|
|
25
|
-
/**
|
|
26
|
-
* getRemoteUserTrackReports
|
|
27
|
-
* @param userId string
|
|
28
|
-
* @param origin 'sfu' | 'p2p'
|
|
29
|
-
* @param direction 'sends' | 'recvs'
|
|
30
|
-
* @param mediaType K_mediaType
|
|
31
|
-
* @returns
|
|
32
|
-
*/
|
|
33
|
-
getRemoteUserTrackReports: (userId: string, origin: "sfu" | "p2p", direction: "sends" | "recvs", mediaType: K_mediaType) => import('../../..').TrackReport | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* getUserContent
|
|
36
|
-
* @param userId string
|
|
37
|
-
* @returns
|
|
38
|
-
*/
|
|
39
|
-
getUserContent: (userId?: string) => LocalUser | RemoteUser | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* getRemoteUserContent
|
|
42
|
-
* @param userId string
|
|
43
|
-
*/
|
|
44
|
-
getRemoteUserContent: (userId: string) => RemoteUser | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* getUserAudioMediaStreamContext
|
|
47
|
-
* @param userId string
|
|
48
|
-
* @param mediaType K_mediaType
|
|
49
|
-
*/
|
|
50
|
-
getUserAudioMediaStreamContext: (userId: string, mediaType: K_mediaType) => import('pr-audio-stream').PrAudioStream | undefined;
|
|
51
|
-
/**
|
|
52
|
-
* setInputVolume
|
|
53
|
-
* @param userId
|
|
54
|
-
* @param mediaType
|
|
55
|
-
* @param gain 0-1
|
|
56
|
-
*/
|
|
57
|
-
setInputVolume: (userId: string, mediaType: K_mediaType, gain: number) => void;
|
|
58
|
-
/**
|
|
59
|
-
* setEnhanceGain
|
|
60
|
-
* @param userId
|
|
61
|
-
* @param mediaType
|
|
62
|
-
* @param gain 0-100
|
|
63
|
-
*/
|
|
64
|
-
setEnhanceGain: (userId: string, mediaType: K_mediaType, gain: number) => Promise<void>;
|
|
65
|
-
/**
|
|
66
|
-
* setSpeakerVolume
|
|
67
|
-
* @param userId
|
|
68
|
-
* @param mediaType
|
|
69
|
-
* @param gain 0-1
|
|
70
|
-
*/
|
|
71
|
-
setSpeakerVolume: (userId: string, mediaType: K_mediaType, gain: number) => void;
|
|
72
|
-
/**
|
|
73
|
-
* getVolume
|
|
74
|
-
* @param userId
|
|
75
|
-
* @param mediaType
|
|
76
|
-
*/
|
|
77
|
-
getVolume: (userId: string, mediaType: K_mediaType) => number | undefined;
|
|
78
|
-
/**
|
|
79
|
-
* playBgs
|
|
80
|
-
* @param userId string
|
|
81
|
-
* @param mediaType K_mediaType
|
|
82
|
-
* @param buffer AudioBuffer
|
|
83
|
-
*/
|
|
84
|
-
playBgs: (userId: string, mediaType: K_mediaType, buffer: AudioBuffer | null) => Promise<void>;
|
|
85
|
-
/**
|
|
86
|
-
* playBgm
|
|
87
|
-
* @param userId string
|
|
88
|
-
* @param mediaType K_mediaType
|
|
89
|
-
* @param buffer AudioBuffer
|
|
90
|
-
*/
|
|
91
|
-
playBgm: (userId: string, mediaType: K_mediaType, buffer: AudioBuffer | null) => Promise<void>;
|
|
92
|
-
/**
|
|
93
|
-
* changBgsMix
|
|
94
|
-
* @param userId string
|
|
95
|
-
* @param mediaType K_mediaType
|
|
96
|
-
* @param gain number 0-1
|
|
97
|
-
*/
|
|
98
|
-
changBgsMix: (userId: string, mediaType: K_mediaType, mix: boolean) => Promise<void>;
|
|
99
|
-
/**
|
|
100
|
-
* changBgmMix
|
|
101
|
-
* @param userId string
|
|
102
|
-
* @param mediaType K_mediaType
|
|
103
|
-
* @param gain number 0-1
|
|
104
|
-
*/
|
|
105
|
-
changBgmMix: (userId: string, mediaType: K_mediaType, mix: boolean) => Promise<void>;
|
|
106
|
-
/**
|
|
107
|
-
* stopBgs
|
|
108
|
-
* @param userId string
|
|
109
|
-
* @param mediaType K_mediaType
|
|
110
|
-
* @param gain number 0-1
|
|
111
|
-
*/
|
|
112
|
-
stopBgs: (userId: string, mediaType: K_mediaType) => Promise<void>;
|
|
113
|
-
/**
|
|
114
|
-
* stopBgm
|
|
115
|
-
* @param userId string
|
|
116
|
-
* @param mediaType K_mediaType
|
|
117
|
-
* @param gain number 0-1
|
|
118
|
-
*/
|
|
119
|
-
stopBgm: (userId: string, mediaType: K_mediaType) => Promise<void>;
|
|
120
|
-
/**
|
|
121
|
-
* setBgsGain
|
|
122
|
-
* @param userId string
|
|
123
|
-
* @param mediaType K_mediaType
|
|
124
|
-
* @param gain number 0-1
|
|
125
|
-
*/
|
|
126
|
-
setBgsGain: (userId: string, mediaType: K_mediaType, gain: number) => Promise<void>;
|
|
127
|
-
/**
|
|
128
|
-
* setBgmGain
|
|
129
|
-
* @param userId string
|
|
130
|
-
* @param mediaType K_mediaType
|
|
131
|
-
* @param gain number 0-1
|
|
132
|
-
*/
|
|
133
|
-
setBgmGain: (userId: string, mediaType: K_mediaType, gain: number) => Promise<void>;
|
|
134
|
-
getrP2PConnectedCount: () => number;
|
|
135
|
-
addRemoteUsersSubscribes: (usersMediaTypes?: UserMediaTypes[]) => void;
|
|
136
|
-
executeRemoteUsersSubscribes: () => {
|
|
137
|
-
id: string;
|
|
138
|
-
tracks: {
|
|
139
|
-
lastRetry: boolean;
|
|
140
|
-
location: string;
|
|
141
|
-
mid: string | null;
|
|
142
|
-
msid?: string | undefined;
|
|
143
|
-
trackName: string;
|
|
144
|
-
userId?: string;
|
|
145
|
-
type: number;
|
|
146
|
-
mediaType: K_mediaType;
|
|
147
|
-
enabled?: boolean;
|
|
148
|
-
origin: "unknown" | "phoney" | "local" | "sfu" | "p2p";
|
|
149
|
-
simulcast?: "f" | "h" | "q";
|
|
150
|
-
}[];
|
|
151
|
-
}[];
|
|
152
|
-
completedRemoteUsersSubscribes: (users: RoomUser[]) => void;
|
|
153
|
-
emitUsersChange: () => void;
|
|
154
|
-
/**
|
|
155
|
-
* getMaxVolumeUser
|
|
156
|
-
*/
|
|
157
|
-
getMaxVolumeUser: () => {
|
|
158
|
-
id: string;
|
|
159
|
-
volume: number;
|
|
160
|
-
} | undefined;
|
|
161
|
-
getUserStream: (userId: string, mediaType: K_mediaType) => MediaStream | undefined;
|
|
162
|
-
getUsersInfo: () => {
|
|
163
|
-
id: string;
|
|
164
|
-
callAction: number;
|
|
165
|
-
callActionStr: string;
|
|
166
|
-
callActionMap: {
|
|
167
|
-
mc_audio?: boolean | undefined;
|
|
168
|
-
mc_video?: boolean | undefined;
|
|
169
|
-
ss_video?: boolean | undefined;
|
|
170
|
-
ss_audio?: boolean | undefined;
|
|
171
|
-
};
|
|
172
|
-
permissions: number;
|
|
173
|
-
permissionsStr: string;
|
|
174
|
-
permissionsMap: {
|
|
175
|
-
mc_audio?: boolean | undefined;
|
|
176
|
-
mc_video?: boolean | undefined;
|
|
177
|
-
ss_video?: boolean | undefined;
|
|
178
|
-
ss_audio?: boolean | undefined;
|
|
179
|
-
};
|
|
180
|
-
banBehavior: number;
|
|
181
|
-
banBehaviorStr: string;
|
|
182
|
-
banBehaviorMap: {
|
|
183
|
-
mc_audio?: boolean | undefined;
|
|
184
|
-
mc_video?: boolean | undefined;
|
|
185
|
-
ss_video?: boolean | undefined;
|
|
186
|
-
ss_audio?: boolean | undefined;
|
|
187
|
-
};
|
|
188
|
-
isOwner: boolean;
|
|
189
|
-
network: {
|
|
190
|
-
egress: number;
|
|
191
|
-
ingress: number;
|
|
192
|
-
};
|
|
193
|
-
tracks: import('../../..').UserTrack[];
|
|
194
|
-
isSelf: boolean;
|
|
195
|
-
}[];
|
|
196
|
-
createRemoteUser: (userId: string) => RemoteUser;
|
|
197
|
-
checkRemoteUser: (userId: string) => boolean;
|
|
198
|
-
removeRemoteUser: (userId: string) => void;
|
|
199
|
-
initUsers: (users: any[]) => void;
|
|
200
|
-
clearUsers: () => void;
|
|
201
|
-
createRemoteUserP2P: (userId: string) => RemoteUserP2P;
|
|
202
|
-
syncRemoteUserP2PSenderStreamTrack: (mediaTypes: K_mediaType[]) => Promise<void>;
|
|
203
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TrackReport } from '../../../../types';
|
|
2
|
-
export declare class LocalTrackAnalysis {
|
|
3
|
-
types: string[];
|
|
4
|
-
trackReport: TrackReport;
|
|
5
|
-
transmittedPackets: number;
|
|
6
|
-
transmittedPacketsLost: number;
|
|
7
|
-
averageQualitys: number[];
|
|
8
|
-
averageOffsetBytesSents: number[];
|
|
9
|
-
isAvailable: number[];
|
|
10
|
-
availableScore: number[];
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* 生成网络信息
|
|
14
|
-
*/
|
|
15
|
-
generate: (pc: RTCPeerConnection, track: MediaStreamTrack | undefined | null) => Promise<TrackReport>;
|
|
16
|
-
/**
|
|
17
|
-
* 清理
|
|
18
|
-
*/
|
|
19
|
-
clear: () => void;
|
|
20
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { K_mediaType } from '../../../../enums/mediaType';
|
|
2
|
-
import { Config } from '../../Config';
|
|
3
|
-
import { LocalMedias } from '../../LocalMedias';
|
|
4
|
-
import { Peer } from '../../Peer';
|
|
5
|
-
import { LocalTrackAnalysis } from './LocalTrackAnalysis';
|
|
6
|
-
import { UserBase } from './UserBase';
|
|
7
|
-
interface LocalUserTracksAnalysis {
|
|
8
|
-
sfu: {
|
|
9
|
-
sends: {
|
|
10
|
-
[key in K_mediaType]: LocalTrackAnalysis;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export declare class LocalUser extends UserBase {
|
|
15
|
-
tracksAnalysis: LocalUserTracksAnalysis;
|
|
16
|
-
constructor({ config, localMedias }: {
|
|
17
|
-
config: Config;
|
|
18
|
-
localMedias: LocalMedias;
|
|
19
|
-
});
|
|
20
|
-
getTrackReports: (mediaType: K_mediaType) => import('../../../..').TrackReport;
|
|
21
|
-
generateTrackAnalysis: (peer: Peer) => Promise<void>;
|
|
22
|
-
/**
|
|
23
|
-
* setActiveNoise
|
|
24
|
-
* @param mediaType K_mediaType
|
|
25
|
-
* @param state boolean
|
|
26
|
-
*/
|
|
27
|
-
setActiveNoise: (mediaType: K_mediaType, state: boolean) => void;
|
|
28
|
-
updateSelfCallAction: () => number;
|
|
29
|
-
checkBanBehavior: (mediaTypes: K_mediaType[]) => boolean;
|
|
30
|
-
useLocalStream: (mediaTypes: K_mediaType[]) => void;
|
|
31
|
-
clear: () => void;
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { ReportInfo, TrackReport } from '../../../../types';
|
|
2
|
-
export declare class RemotePeerTrackAnalysis {
|
|
3
|
-
reports: ReportInfo[];
|
|
4
|
-
trackReport: TrackReport;
|
|
5
|
-
transmittedPackets: number;
|
|
6
|
-
transmittedPacketsLost: number;
|
|
7
|
-
averageQualitys: number[];
|
|
8
|
-
averageOffsetBytesSents: number[];
|
|
9
|
-
isAvailable: number[];
|
|
10
|
-
availableScore: number[];
|
|
11
|
-
constructor();
|
|
12
|
-
/**
|
|
13
|
-
* 生成网络信息
|
|
14
|
-
*/
|
|
15
|
-
generate: (pc: RTCPeerConnection, track: MediaStreamTrack | undefined | null) => Promise<TrackReport>;
|
|
16
|
-
/**
|
|
17
|
-
* 清理
|
|
18
|
-
*/
|
|
19
|
-
clear: () => void;
|
|
20
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { UserBase } from './UserBase';
|
|
2
|
-
import { K_mediaType } from '../../../../enums/mediaType';
|
|
3
|
-
import { LocalMedias } from '../../LocalMedias';
|
|
4
|
-
import { RemoteUserP2P } from './RemoteUserP2P';
|
|
5
|
-
import { Config } from '../../Config';
|
|
6
|
-
import { Peer } from '../../Peer';
|
|
7
|
-
import { LocalTrackAnalysis } from './LocalTrackAnalysis';
|
|
8
|
-
import { RemotePeerTrackAnalysis } from './RemotePeerTrackAnalysis';
|
|
9
|
-
interface RemoteUserTracksAnalysis {
|
|
10
|
-
sfu: {
|
|
11
|
-
recvs: {
|
|
12
|
-
[key in K_mediaType]: RemotePeerTrackAnalysis;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
p2p: {
|
|
16
|
-
sends: {
|
|
17
|
-
[key in K_mediaType]: LocalTrackAnalysis;
|
|
18
|
-
};
|
|
19
|
-
recvs: {
|
|
20
|
-
[key in K_mediaType]: RemotePeerTrackAnalysis;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare class RemoteUser extends UserBase {
|
|
25
|
-
tracksAnalysis: RemoteUserTracksAnalysis;
|
|
26
|
-
/**
|
|
27
|
-
* 订阅状态 剩余订阅次数
|
|
28
|
-
*/
|
|
29
|
-
subscribeState: {
|
|
30
|
-
[key in K_mediaType]?: number;
|
|
31
|
-
};
|
|
32
|
-
publishWaiting: {
|
|
33
|
-
[key in K_mediaType]?: number;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* 数据接收器
|
|
37
|
-
*/
|
|
38
|
-
audioReceiver: {
|
|
39
|
-
[key in K_mediaType]?: HTMLAudioElement;
|
|
40
|
-
};
|
|
41
|
-
p2p?: RemoteUserP2P;
|
|
42
|
-
constructor({ config, localMedias }: {
|
|
43
|
-
config: Config;
|
|
44
|
-
localMedias: LocalMedias;
|
|
45
|
-
});
|
|
46
|
-
getTrackReports: (origin: "sfu" | "p2p", direction: "sends" | "recvs", mediaType: K_mediaType) => import('../../../..').TrackReport | undefined;
|
|
47
|
-
generateTrackAnalysis: (peer: Peer) => Promise<void>;
|
|
48
|
-
addSubscribe: (mediaTypes: K_mediaType[], count?: number) => void;
|
|
49
|
-
executeSubscribe: () => {
|
|
50
|
-
id: string;
|
|
51
|
-
tracks: {
|
|
52
|
-
lastRetry: boolean;
|
|
53
|
-
location: string;
|
|
54
|
-
mid: string | null;
|
|
55
|
-
msid?: string | undefined;
|
|
56
|
-
trackName: string;
|
|
57
|
-
userId?: string;
|
|
58
|
-
type: number;
|
|
59
|
-
mediaType: K_mediaType;
|
|
60
|
-
enabled?: boolean;
|
|
61
|
-
origin: "unknown" | "phoney" | "local" | "sfu" | "p2p";
|
|
62
|
-
simulcast?: "f" | "h" | "q";
|
|
63
|
-
}[];
|
|
64
|
-
};
|
|
65
|
-
completedSubscribe: (mediaTypes: K_mediaType[]) => void;
|
|
66
|
-
setPublishWaiting: (mediaTypes: K_mediaType[]) => void;
|
|
67
|
-
checkSubscribed: (mediaTypes: K_mediaType[], origin?: "sfu" | "p2p" | "all") => {
|
|
68
|
-
subscribed_mediaTypes: ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
69
|
-
prohibited_mediaTypes: ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
70
|
-
};
|
|
71
|
-
useRemoteStream: (mediaTypes: K_mediaType[], peer: Peer) => void;
|
|
72
|
-
useRemoteP2PStream: (mediaTypes: K_mediaType[]) => void;
|
|
73
|
-
clear: () => void;
|
|
74
|
-
}
|
|
75
|
-
export {};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { PrResolves } from '../../PrResolves';
|
|
2
|
-
import { K_mediaType } from '../../../../enums/mediaType';
|
|
3
|
-
import { Config } from '../../Config';
|
|
4
|
-
export interface MediaTypeTransceiver {
|
|
5
|
-
mid: number | string | null;
|
|
6
|
-
mediaType: K_mediaType;
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
}
|
|
9
|
-
interface On {
|
|
10
|
-
state?: (_state: 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed') => void;
|
|
11
|
-
close?: () => void;
|
|
12
|
-
setSendTracksEnabled?: (mediaTypes: K_mediaType[]) => void;
|
|
13
|
-
}
|
|
14
|
-
export declare class RemoteUserP2P {
|
|
15
|
-
config: Config;
|
|
16
|
-
prResolves: PrResolves<string>;
|
|
17
|
-
remoteUserId: string;
|
|
18
|
-
peer?: RTCPeerConnection;
|
|
19
|
-
timer?: NodeJS.Timeout;
|
|
20
|
-
channelLocal?: RTCDataChannel;
|
|
21
|
-
channelRemote?: RTCDataChannel;
|
|
22
|
-
channelRemoteList: RTCDataChannel[];
|
|
23
|
-
icecandidates: RTCIceCandidate[];
|
|
24
|
-
isCandidateCollected: boolean;
|
|
25
|
-
transceiverSend: Map<"mc_audio" | "mc_video" | "ss_video" | "ss_audio", RTCRtpTransceiver>;
|
|
26
|
-
transceiverRecv: Map<"mc_audio" | "mc_video" | "ss_video" | "ss_audio", RTCRtpTransceiver>;
|
|
27
|
-
activeSend: {
|
|
28
|
-
[key in K_mediaType]?: number;
|
|
29
|
-
};
|
|
30
|
-
activeRecv: {
|
|
31
|
-
[key in K_mediaType]?: number;
|
|
32
|
-
};
|
|
33
|
-
on: On;
|
|
34
|
-
waitings: {
|
|
35
|
-
candidateCollected: () => Promise<unknown>;
|
|
36
|
-
remoteChannelConnected: () => Promise<unknown>;
|
|
37
|
-
connected: () => Promise<unknown>;
|
|
38
|
-
setOffered: () => Promise<unknown>;
|
|
39
|
-
};
|
|
40
|
-
constructor({ config, remoteUserId }: {
|
|
41
|
-
config: Config;
|
|
42
|
-
remoteUserId: string;
|
|
43
|
-
});
|
|
44
|
-
remoteChannelSend: (message: any) => Promise<void>;
|
|
45
|
-
init: () => void;
|
|
46
|
-
getSenderTrack: (mediaType: K_mediaType) => MediaStreamTrack | null | undefined;
|
|
47
|
-
getRecvierTrack: (mediaType: K_mediaType) => MediaStreamTrack | undefined;
|
|
48
|
-
syncRecvTracksEnabled: () => void;
|
|
49
|
-
initSenders: (mediaType_transceivers?: MediaTypeTransceiver[], direction?: RTCRtpTransceiverDirection) => ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
50
|
-
initRecvs: (mediaTypes?: K_mediaType[], direction?: RTCRtpTransceiverDirection) => ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
51
|
-
hasRecvier: (mediaType: K_mediaType) => Promise<boolean>;
|
|
52
|
-
hasSender: (mediaType: K_mediaType) => Promise<boolean>;
|
|
53
|
-
checkActive: () => boolean;
|
|
54
|
-
replaceSenderTrack: (mediaType: K_mediaType, track: MediaStreamTrack | null) => Promise<void>;
|
|
55
|
-
setSendTracksEnabled: (mediaTypes: K_mediaType[] | undefined, enabled: boolean, origin: "local" | "remote") => ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
56
|
-
setRecvTracksEnabled: (mediaTypes: K_mediaType[] | undefined, enabled: boolean) => ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[];
|
|
57
|
-
setRTCRtpSenderParameters: (parameters: Partial<RTCRtpSendParameters>, mediaTypes?: K_mediaType[]) => Promise<void>;
|
|
58
|
-
createOffer: () => Promise<RTCSessionDescriptionInit>;
|
|
59
|
-
setOffer: (offer: RTCSessionDescriptionInit) => Promise<void>;
|
|
60
|
-
createAnswer: () => Promise<RTCSessionDescriptionInit>;
|
|
61
|
-
setAnswer: (answer: RTCSessionDescriptionInit) => Promise<void>;
|
|
62
|
-
getIcecandidates: () => Promise<RTCIceCandidate[]>;
|
|
63
|
-
addCandidates: (remote_candidates: RTCIceCandidateInit[]) => Promise<void>;
|
|
64
|
-
getSenderUserTracks: (mediaTypes?: K_mediaType[]) => {
|
|
65
|
-
type: number;
|
|
66
|
-
enabled: boolean;
|
|
67
|
-
trackName: string;
|
|
68
|
-
mid: string | null;
|
|
69
|
-
mediaType: string;
|
|
70
|
-
}[];
|
|
71
|
-
getRecvUserTracks: (mediaTypes?: K_mediaType[]) => {
|
|
72
|
-
type: number;
|
|
73
|
-
enabled: boolean;
|
|
74
|
-
trackName: string;
|
|
75
|
-
mid: string | null;
|
|
76
|
-
mediaType: string;
|
|
77
|
-
isActive: number | undefined;
|
|
78
|
-
}[];
|
|
79
|
-
checkReceActive: (mediaType: K_mediaType) => number | false;
|
|
80
|
-
getTrack: (mediaType: K_mediaType) => MediaStreamTrack | undefined;
|
|
81
|
-
checkPeer: () => RTCPeerConnection;
|
|
82
|
-
close: () => void;
|
|
83
|
-
destroy: () => Promise<void>;
|
|
84
|
-
private _clear;
|
|
85
|
-
private _filterSdp;
|
|
86
|
-
}
|
|
87
|
-
export {};
|