quickvo-sdk-js 0.3.1 → 0.4.1
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/README.md +4 -0
- package/dist/enums/eventName.d.ts +3 -1
- package/dist/enums/notifyName.d.ts +2 -2
- package/dist/enums/roomState.d.ts +3 -2
- package/dist/index.js +4906 -4137
- package/dist/index.umd.cjs +2 -2
- package/dist/protos/compiled.d.ts +685 -115
- package/dist/room/CallsWebSocket.d.ts +5 -4
- package/dist/room/RoomBase.d.ts +8 -5
- package/dist/room/RoomCalls.d.ts +26 -9
- package/dist/room/RoomMedias.d.ts +4 -7
- package/dist/room/RoomPeer.d.ts +25 -9
- package/dist/room/mediaStreams/VideoMediaContext.d.ts +1 -0
- package/dist/tools.d.ts +2 -0
- package/package.json +3 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PrWebSocket } from 'pr-ws';
|
|
2
1
|
import { Message, Notify, SendMessageRevolve } from '../types';
|
|
3
2
|
import { K_notifyName } from '../enums/notifyName';
|
|
4
3
|
export interface CallsWebSocketOptions {
|
|
@@ -17,16 +16,18 @@ export interface CallsWebSocketOptions {
|
|
|
17
16
|
}
|
|
18
17
|
export declare class CallsWebSocket {
|
|
19
18
|
#private;
|
|
20
|
-
|
|
21
|
-
onReconnectStop: (_e: any) => Promise<void>;
|
|
19
|
+
state: 'connecting' | 'connected' | 'closed';
|
|
22
20
|
constructor(_options?: CallsWebSocketOptions);
|
|
21
|
+
sendMessageBefore: () => Promise<void>;
|
|
22
|
+
onReconnectSuccess: (_e: any) => void;
|
|
23
|
+
onReconnectStop: (_e: any) => void;
|
|
23
24
|
clearEvents: (sns?: string[]) => void;
|
|
24
25
|
/**
|
|
25
26
|
* 连接
|
|
26
27
|
* @param session
|
|
27
28
|
* @returns
|
|
28
29
|
*/
|
|
29
|
-
connect: (session?: string) => Promise<
|
|
30
|
+
connect: (session?: string) => Promise<unknown>;
|
|
30
31
|
/**
|
|
31
32
|
* 关闭
|
|
32
33
|
*/
|
package/dist/room/RoomBase.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { K_roomState } from '../enums/roomState';
|
|
2
2
|
import { QuickOptions, RoomOptions, RoomUser, UserTrack } from '../types';
|
|
3
3
|
import { CallsWebSocket, CallsWebSocketOptions } from './CallsWebSocket';
|
|
4
|
-
import {
|
|
4
|
+
import { PrTaskQueue } from 'pr-task-queue';
|
|
5
5
|
type Options = QuickOptions & RoomOptions & CallsWebSocketOptions;
|
|
6
6
|
export declare class RoomBase {
|
|
7
7
|
options: Options;
|
|
8
8
|
prohibitNotify: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
isEarly: boolean;
|
|
10
|
+
taskQueue: PrTaskQueue<"closeTrack" | "subscribe" | "createWs" | "createSession" | "ice" | "createTrack">;
|
|
11
|
+
roomState: K_roomState;
|
|
11
12
|
createAt: number;
|
|
12
13
|
cwsIns: CallsWebSocket;
|
|
13
14
|
peerIns: RTCPeerConnection;
|
|
15
|
+
transceiverMap: Map<"microphoneCamera_audio" | "microphoneCamera_video" | "screenSharing_video" | "screenSharing_audio", RTCRtpTransceiver>;
|
|
14
16
|
userMap: Map<string, RoomUser>;
|
|
15
17
|
mediaDevicesErrInfo: {
|
|
16
18
|
microphoneCamera_audio: string;
|
|
@@ -19,11 +21,12 @@ export declare class RoomBase {
|
|
|
19
21
|
screenSharing_audio: string;
|
|
20
22
|
};
|
|
21
23
|
constructor();
|
|
24
|
+
initAsyncQueue: () => void;
|
|
22
25
|
/**
|
|
23
26
|
* 获取房间信息
|
|
24
27
|
*/
|
|
25
28
|
getRoomInfo: () => {
|
|
26
|
-
|
|
29
|
+
roomState: string;
|
|
27
30
|
createAt: number;
|
|
28
31
|
appid: string;
|
|
29
32
|
url?: string;
|
|
@@ -41,7 +44,7 @@ export declare class RoomBase {
|
|
|
41
44
|
*/
|
|
42
45
|
setRoomState: (state: K_roomState) => void;
|
|
43
46
|
/**
|
|
44
|
-
*
|
|
47
|
+
* 设置SDK属性
|
|
45
48
|
*/
|
|
46
49
|
setOptions: (options: Partial<Options>) => Promise<void>;
|
|
47
50
|
/**
|
package/dist/room/RoomCalls.d.ts
CHANGED
|
@@ -32,6 +32,12 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
32
32
|
* @returns Promise<boolean>
|
|
33
33
|
*/
|
|
34
34
|
quitRoom: () => Promise<boolean>;
|
|
35
|
+
/**
|
|
36
|
+
* 退出房间 不断开连接
|
|
37
|
+
* @example quickvo.quitRoomEx()
|
|
38
|
+
* @returns Promise<boolean>
|
|
39
|
+
*/
|
|
40
|
+
quitRoomEx: () => Promise<boolean>;
|
|
35
41
|
/**
|
|
36
42
|
* 同步房间信息
|
|
37
43
|
* @example quickvo.syncRoomInfo()
|
|
@@ -40,18 +46,17 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
40
46
|
/**
|
|
41
47
|
* 发布流
|
|
42
48
|
* @param mediaTypes MediaType[]
|
|
43
|
-
* @param count 发布失败重试次数
|
|
44
49
|
* @example quickvo.publish(['microphoneCamera_audio', 'microphoneCamera_video'], 3)
|
|
45
50
|
* @returns Promise<RoomUser>
|
|
46
51
|
*/
|
|
47
|
-
publish: (mediaTypes: K_mediaType[]
|
|
52
|
+
publish: (mediaTypes: K_mediaType[]) => Promise<RoomUser>;
|
|
48
53
|
/**
|
|
49
54
|
* 停止发布流
|
|
50
55
|
* @param trackNames string[] = []
|
|
51
56
|
* @example quickvo.stopPublish(['microphoneCamera_audio'])
|
|
52
57
|
* @returns Promise<RoomUser>
|
|
53
58
|
*/
|
|
54
|
-
stopPublish: (mediaTypes?: K_mediaType[]) => Promise<
|
|
59
|
+
stopPublish: (mediaTypes?: K_mediaType[]) => Promise<RoomUser>;
|
|
55
60
|
/**
|
|
56
61
|
* 订阅流
|
|
57
62
|
* @param trackNames 轨道名称
|
|
@@ -59,30 +64,42 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
59
64
|
* @example quickvo.subscribe(['trackName1','trackName2'])
|
|
60
65
|
* @returns Promise<RoomUser[]>
|
|
61
66
|
*/
|
|
62
|
-
subscribe: (trackNames?: string[], count?: number) => Promise<
|
|
67
|
+
subscribe: (trackNames?: string[], count?: number) => Promise<RoomUser[]>;
|
|
63
68
|
/**
|
|
64
69
|
* 停止订阅流
|
|
65
70
|
* @param trackNames string[] = []
|
|
66
71
|
* @example quickvo.subscribe(['trackName1'])
|
|
67
72
|
*/
|
|
68
|
-
stopSubscribe: (trackNames?: string[]) => Promise<
|
|
73
|
+
stopSubscribe: (trackNames?: string[]) => Promise<boolean>;
|
|
69
74
|
/**
|
|
70
75
|
* 冻结轨道
|
|
71
76
|
* @param mediaTypes MediaType[] 轨道类型
|
|
72
77
|
* @param enabled 是否冻结
|
|
73
78
|
* @example quickvo.inactiveTracks(['microphoneCamera_audio'], false)
|
|
74
79
|
*/
|
|
75
|
-
inactiveTracks: (mediaTypes: K_mediaType[], enabled: boolean) => Promise<
|
|
80
|
+
inactiveTracks: (mediaTypes: K_mediaType[], enabled: boolean) => Promise<boolean>;
|
|
76
81
|
/**
|
|
77
82
|
* 远端调试
|
|
78
83
|
*/
|
|
79
84
|
debugger: () => Promise<any>;
|
|
85
|
+
/**
|
|
86
|
+
* 协商流
|
|
87
|
+
*/
|
|
88
|
+
renegotiate: () => Promise<unknown>;
|
|
89
|
+
/**
|
|
90
|
+
* 创建连接
|
|
91
|
+
*/
|
|
92
|
+
createWs: () => Promise<unknown>;
|
|
80
93
|
/**
|
|
81
94
|
* 创建cf会话
|
|
82
95
|
*/
|
|
83
|
-
createSession: () => Promise<
|
|
96
|
+
createSession: () => Promise<unknown>;
|
|
84
97
|
/**
|
|
85
|
-
*
|
|
98
|
+
* 创建媒体轨道
|
|
86
99
|
*/
|
|
87
|
-
|
|
100
|
+
createTrack: (mediaTypes: K_mediaType[]) => Promise<unknown>;
|
|
101
|
+
/**
|
|
102
|
+
* 提前建连
|
|
103
|
+
*/
|
|
104
|
+
earlyConnect: () => void;
|
|
88
105
|
}
|
|
@@ -7,6 +7,7 @@ export declare class RoomMedias extends RoomBase {
|
|
|
7
7
|
#private;
|
|
8
8
|
mediaDevices: MediaDeviceInfo[];
|
|
9
9
|
constructor();
|
|
10
|
+
getPhoneyStreams: (mediaType: K_mediaType) => MediaStream;
|
|
10
11
|
/**
|
|
11
12
|
* 房间所有用户所有媒体流变化
|
|
12
13
|
*/
|
|
@@ -51,13 +52,9 @@ export declare class RoomMedias extends RoomBase {
|
|
|
51
52
|
*/
|
|
52
53
|
setMediaTrackConstraints: (mediaType: K_mediaType, constraints: MediaTrackConstraints) => Promise<void>;
|
|
53
54
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @param mediaType MediaType
|
|
56
|
-
* @param active 激活状态
|
|
57
|
-
* @example quickvo.setLocalStream('microphoneCamera_audio', false)
|
|
58
|
-
* @returns Promise<Streams>
|
|
55
|
+
* 初始化本地流
|
|
59
56
|
*/
|
|
60
|
-
|
|
57
|
+
initLocalStream: (mediaType: K_mediaType) => Promise<void>;
|
|
61
58
|
/**
|
|
62
59
|
* 获取正在使用的媒体设备ID
|
|
63
60
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
@@ -67,7 +64,7 @@ export declare class RoomMedias extends RoomBase {
|
|
|
67
64
|
/**
|
|
68
65
|
* 替换发射器媒体流
|
|
69
66
|
*/
|
|
70
|
-
replaceSenderStream: (
|
|
67
|
+
replaceSenderStream: (mediaTypes: K_mediaType[] | undefined, isReal: Boolean) => Promise<void>;
|
|
71
68
|
/**
|
|
72
69
|
* 设置正在使用的媒体设备
|
|
73
70
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
package/dist/room/RoomPeer.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export declare class RoomPeer extends RoomUsers {
|
|
|
7
7
|
getPeerStatsTimer: number;
|
|
8
8
|
reports: any[];
|
|
9
9
|
peerNetwork: {
|
|
10
|
+
inboundBytes: number;
|
|
11
|
+
outboundBytes: number;
|
|
10
12
|
lostRate: string;
|
|
11
13
|
roundTripTime: string;
|
|
12
14
|
jitter: string;
|
|
@@ -15,25 +17,27 @@ export declare class RoomPeer extends RoomUsers {
|
|
|
15
17
|
constructor();
|
|
16
18
|
initPeer: () => void;
|
|
17
19
|
/**
|
|
18
|
-
*
|
|
20
|
+
* 获取发射器轨道信息
|
|
19
21
|
*/
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 添加发射器
|
|
23
|
-
*/
|
|
24
|
-
addSender: (mediaType: K_mediaType, withTrack: MediaStreamTrack) => Promise<{
|
|
22
|
+
getSenderTracks: (mediaTypes?: K_mediaType[]) => {
|
|
25
23
|
type: number;
|
|
26
24
|
enabled: boolean;
|
|
27
25
|
trackName: string;
|
|
28
26
|
location: string;
|
|
29
27
|
mid: string | null;
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
}[];
|
|
29
|
+
/**
|
|
30
|
+
* 添加发射器
|
|
31
|
+
*/
|
|
32
|
+
addSenders: (mediaTypes?: K_mediaType[]) => Promise<("microphoneCamera_audio" | "microphoneCamera_video" | "screenSharing_video" | "screenSharing_audio")[]>;
|
|
33
|
+
/**
|
|
34
|
+
* 移除发射器
|
|
35
|
+
*/
|
|
36
|
+
removeSenders: (mediaTypes?: K_mediaType[]) => Promise<void>;
|
|
32
37
|
/**
|
|
33
38
|
* 清理收发器
|
|
34
39
|
*/
|
|
35
40
|
clearTransceivers: () => Promise<void>;
|
|
36
|
-
connectionICE: () => Promise<unknown>;
|
|
37
41
|
/**
|
|
38
42
|
* 监听订阅轨道结果
|
|
39
43
|
*/
|
|
@@ -56,6 +60,8 @@ export declare class RoomPeer extends RoomUsers {
|
|
|
56
60
|
* 获取peer网络情况
|
|
57
61
|
*/
|
|
58
62
|
getPeerNetwork: () => {
|
|
63
|
+
inboundBytes: number;
|
|
64
|
+
outboundBytes: number;
|
|
59
65
|
lostRate: string;
|
|
60
66
|
roundTripTime: string;
|
|
61
67
|
jitter: string;
|
|
@@ -76,6 +82,16 @@ export declare class RoomPeer extends RoomUsers {
|
|
|
76
82
|
* 获取分析报告
|
|
77
83
|
*/
|
|
78
84
|
getReportsByMid: (mids?: string[]) => Promise<any[]>;
|
|
85
|
+
/**
|
|
86
|
+
* 获取房间网络信息
|
|
87
|
+
*/
|
|
88
|
+
getRoomNetwork: () => {
|
|
89
|
+
inboundBytes: number;
|
|
90
|
+
outboundBytes: number;
|
|
91
|
+
lostRate: string;
|
|
92
|
+
roundTripTime: string;
|
|
93
|
+
jitter: string;
|
|
94
|
+
};
|
|
79
95
|
/**
|
|
80
96
|
* 停止网络报告分析
|
|
81
97
|
*/
|
package/dist/tools.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quickvo-sdk-js",
|
|
3
3
|
"description": "提供快捷接入单对单、单对多、群体会议、舞台会议等音视频功能。",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"pako": "^2.1.0",
|
|
23
|
-
"pr-
|
|
23
|
+
"pr-task-queue": "^0.1.0",
|
|
24
24
|
"pr-tools": "^1.5.1",
|
|
25
|
-
"pr-ws": "^0.2.
|
|
25
|
+
"pr-ws": "^0.2.5",
|
|
26
26
|
"sdp-transform": "^2.15.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|