quickvo-sdk-js 0.5.7 → 0.5.9
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 +16 -2
- package/dist/QuickVO.d.ts +7 -1
- package/dist/index.js +327 -280
- package/dist/index.umd.cjs +2 -2
- package/dist/room/Room.d.ts +2 -1
- package/dist/room/RoomBase.d.ts +11 -7
- package/dist/room/RoomCalls.d.ts +15 -30
- package/dist/room/RoomMedias.d.ts +2 -2
- package/dist/room/RoomPeer.d.ts +2 -2
- package/dist/room/RoomUsers.d.ts +4 -4
- package/dist/room/mediaStreams/AudioMediaContext.d.ts +8 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
package/dist/room/Room.d.ts
CHANGED
package/dist/room/RoomBase.d.ts
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { K_roomState } from '../enums/roomState';
|
|
2
|
-
import { QuickOptions, RoomOptions, RoomUser, UserTrack } from '../types';
|
|
2
|
+
import { QuickOptions, Report_Log_Type, RoomOptions, RoomUser, UserTrack } from '../types';
|
|
3
3
|
import { CallsWebSocket, CallsWebSocketOptions } from './CallsWebSocket';
|
|
4
4
|
import { K_mediaType } from '../enums/mediaType';
|
|
5
5
|
import { PrTaskQueue } from 'pr-task-queue';
|
|
6
|
-
type Options = QuickOptions & RoomOptions & CallsWebSocketOptions
|
|
6
|
+
type Options = QuickOptions & RoomOptions & CallsWebSocketOptions & {
|
|
7
|
+
earlyId?: string;
|
|
8
|
+
};
|
|
7
9
|
export declare class RoomBase {
|
|
8
10
|
#private;
|
|
9
11
|
options: Options;
|
|
10
12
|
prohibitNotify: boolean;
|
|
11
13
|
isEarly: boolean;
|
|
14
|
+
isInRoom: boolean;
|
|
12
15
|
taskQueue: PrTaskQueue<"closeTrack" | "subscribe" | "joinRoom" | "createWs" | "createSession" | "ice" | "createTrack">;
|
|
13
16
|
roomState: K_roomState;
|
|
14
17
|
createAt: number;
|
|
@@ -23,7 +26,11 @@ export declare class RoomBase {
|
|
|
23
26
|
screenSharing_video: string;
|
|
24
27
|
screenSharing_audio: string;
|
|
25
28
|
};
|
|
26
|
-
constructor();
|
|
29
|
+
constructor(options: QuickOptions);
|
|
30
|
+
/**
|
|
31
|
+
* 提交日志
|
|
32
|
+
*/
|
|
33
|
+
reportLogs: (type: Report_Log_Type, describe?: string) => void;
|
|
27
34
|
/**
|
|
28
35
|
* 获取房间信息
|
|
29
36
|
*/
|
|
@@ -40,6 +47,7 @@ export declare class RoomBase {
|
|
|
40
47
|
callType: number;
|
|
41
48
|
newPublishAutoSubscribe?: boolean;
|
|
42
49
|
timeout?: number;
|
|
50
|
+
earlyId?: string;
|
|
43
51
|
};
|
|
44
52
|
/**
|
|
45
53
|
* 设置房间状态
|
|
@@ -49,10 +57,6 @@ export declare class RoomBase {
|
|
|
49
57
|
* 设置SDK属性
|
|
50
58
|
*/
|
|
51
59
|
setOptions: (options: Partial<Options>) => Promise<void>;
|
|
52
|
-
/**
|
|
53
|
-
* 初始化通讯实例
|
|
54
|
-
*/
|
|
55
|
-
initCwsCall: () => void;
|
|
56
60
|
/**
|
|
57
61
|
* 获取媒体设备错误信息
|
|
58
62
|
*/
|
package/dist/room/RoomCalls.d.ts
CHANGED
|
@@ -1,18 +1,25 @@
|
|
|
1
1
|
import { K_mediaType } from '../enums/mediaType';
|
|
2
|
-
import {
|
|
2
|
+
import { QuickOptions, RoomOptions, RoomUser, Streams } from '../types';
|
|
3
3
|
import { RoomPeer } from './RoomPeer';
|
|
4
4
|
export declare class RoomCalls extends RoomPeer {
|
|
5
5
|
#private;
|
|
6
6
|
sdk_service_version: string;
|
|
7
|
-
constructor();
|
|
7
|
+
constructor(options: QuickOptions);
|
|
8
|
+
/**
|
|
9
|
+
* 预连接
|
|
10
|
+
* @param mediaTypes MediaType[]
|
|
11
|
+
* @example quickvo.earlyConnect(['microphoneCamera_audio', 'microphoneCamera_video'])
|
|
12
|
+
*/
|
|
13
|
+
earlyConnect: (mediaTypes?: K_mediaType[]) => void;
|
|
8
14
|
/**
|
|
9
15
|
* 设置本地流
|
|
10
16
|
* @param mediaType MediaType
|
|
11
17
|
* @param active 激活状态
|
|
12
18
|
* @example quickvo.setLocalStream('microphoneCamera_audio', false)
|
|
19
|
+
* @example quickvo.setLocalStream(['microphoneCamera_audio', 'microphoneCamera_video'], false)
|
|
13
20
|
* @returns Promise<Streams>
|
|
14
21
|
*/
|
|
15
|
-
setLocalStream: (mediaTypes: K_mediaType[], active: boolean) => Promise<Streams>;
|
|
22
|
+
setLocalStream: (mediaTypes: K_mediaType[] | K_mediaType, active: boolean) => Promise<Streams>;
|
|
16
23
|
/**
|
|
17
24
|
* 设置正在使用的媒体设备
|
|
18
25
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
@@ -20,17 +27,11 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
20
27
|
*/
|
|
21
28
|
setMediaDeviceKind: (mediaDeviceKind: MediaDeviceKind, deviceId: string) => Promise<void>;
|
|
22
29
|
/**
|
|
23
|
-
*
|
|
30
|
+
* 改变屏幕共享流
|
|
24
31
|
* @param mediaDeviceKind 设备类型 "audioinput" | "audiooutput" | "videoinput"
|
|
25
32
|
* @param deviceId 设备ID
|
|
26
33
|
*/
|
|
27
34
|
changeScreenSharing: (mediaTypes: ("screenSharing_video" | "screenSharing_audio")[]) => Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* 添加广播事件
|
|
30
|
-
* @param notify Notify
|
|
31
|
-
* @returns sn
|
|
32
|
-
*/
|
|
33
|
-
addNotify: (notify: Notify) => string;
|
|
34
35
|
/**
|
|
35
36
|
* 加入房间
|
|
36
37
|
* @param roomOptions RoomOptions
|
|
@@ -77,6 +78,10 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
77
78
|
* @returns Promise<RoomUser[]>
|
|
78
79
|
*/
|
|
79
80
|
subscribe: (trackNames?: string[], count?: number) => Promise<RoomUser[]>;
|
|
81
|
+
/**
|
|
82
|
+
* 协商流
|
|
83
|
+
*/
|
|
84
|
+
renegotiate: () => Promise<unknown>;
|
|
80
85
|
/**
|
|
81
86
|
* 停止订阅流
|
|
82
87
|
* @param trackNames string[] = []
|
|
@@ -94,24 +99,4 @@ export declare class RoomCalls extends RoomPeer {
|
|
|
94
99
|
* 远端调试
|
|
95
100
|
*/
|
|
96
101
|
debugger: () => Promise<any>;
|
|
97
|
-
/**
|
|
98
|
-
* 协商流
|
|
99
|
-
*/
|
|
100
|
-
renegotiate: () => Promise<unknown>;
|
|
101
|
-
/**
|
|
102
|
-
* 创建连接
|
|
103
|
-
*/
|
|
104
|
-
createWs: () => Promise<unknown>;
|
|
105
|
-
/**
|
|
106
|
-
* 创建cf会话
|
|
107
|
-
*/
|
|
108
|
-
createSession: () => Promise<unknown> | undefined;
|
|
109
|
-
/**
|
|
110
|
-
* 创建媒体轨道
|
|
111
|
-
*/
|
|
112
|
-
createTrack: (mediaTypes: K_mediaType[]) => Promise<unknown>;
|
|
113
|
-
/**
|
|
114
|
-
* 提前建连
|
|
115
|
-
*/
|
|
116
|
-
earlyConnect: (mediaTypes?: K_mediaType[]) => void;
|
|
117
102
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { K_mediaType } from '../enums/mediaType';
|
|
2
|
-
import { Streams } from '../types';
|
|
2
|
+
import { QuickOptions, Streams } from '../types';
|
|
3
3
|
import { AudioMediaContext } from './mediaStreams/AudioMediaContext';
|
|
4
4
|
import { VideoMediaContext } from './mediaStreams/VideoMediaContext';
|
|
5
5
|
import { RoomBase } from './RoomBase';
|
|
6
6
|
export declare class RoomMedias extends RoomBase {
|
|
7
7
|
#private;
|
|
8
|
-
constructor();
|
|
8
|
+
constructor(options: QuickOptions);
|
|
9
9
|
/**
|
|
10
10
|
* 房间所有用户所有媒体流变化
|
|
11
11
|
*/
|
package/dist/room/RoomPeer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { K_callStrategy } from '../enums/callStrategy';
|
|
2
2
|
import { K_mediaType } from '../enums/mediaType';
|
|
3
|
-
import { UserTrack } from '../types';
|
|
3
|
+
import { QuickOptions, UserTrack } from '../types';
|
|
4
4
|
import { RoomUsers } from './RoomUsers';
|
|
5
5
|
export declare class RoomPeer extends RoomUsers {
|
|
6
6
|
#private;
|
|
@@ -13,7 +13,7 @@ export declare class RoomPeer extends RoomUsers {
|
|
|
13
13
|
roundTripTime: string;
|
|
14
14
|
jitter: string;
|
|
15
15
|
};
|
|
16
|
-
constructor();
|
|
16
|
+
constructor(options: QuickOptions);
|
|
17
17
|
initPeer: () => void;
|
|
18
18
|
/**
|
|
19
19
|
* 替换发射器媒体流
|
package/dist/room/RoomUsers.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { K_mediaType } from '../enums/mediaType';
|
|
2
|
-
import { RoomUser, UserTrack } from '../types';
|
|
2
|
+
import { QuickOptions, RoomUser, UserTrack } from '../types';
|
|
3
3
|
import { RoomMedias } from './RoomMedias';
|
|
4
4
|
import { UserAudioFilterOptions } from './mediaStreams/AudioMediaContext';
|
|
5
5
|
export declare class RoomUsers extends RoomMedias {
|
|
6
|
-
constructor();
|
|
6
|
+
constructor(options: QuickOptions);
|
|
7
7
|
/**
|
|
8
8
|
* 获取最大音量用户
|
|
9
9
|
*/
|
|
@@ -19,14 +19,14 @@ export declare class RoomUsers extends RoomMedias {
|
|
|
19
19
|
* 设置增强音量
|
|
20
20
|
* @param userId
|
|
21
21
|
* @param mediaType
|
|
22
|
-
* @param gain
|
|
22
|
+
* @param gain 0-100
|
|
23
23
|
*/
|
|
24
24
|
setEnhanceGain: (userId: string, mediaType: K_mediaType, gain: number) => Promise<void>;
|
|
25
25
|
/**
|
|
26
26
|
* 设置音量
|
|
27
27
|
* @param userId
|
|
28
28
|
* @param mediaType
|
|
29
|
-
* @param gain
|
|
29
|
+
* @param gain 0-1
|
|
30
30
|
*/
|
|
31
31
|
setVolume: (userId: string, mediaType: K_mediaType, gain: number) => void;
|
|
32
32
|
/**
|
|
@@ -7,9 +7,12 @@ export declare class AudioMediaContext {
|
|
|
7
7
|
options: UserAudioFilterOptions;
|
|
8
8
|
kind: "audio";
|
|
9
9
|
stream: MediaStream;
|
|
10
|
+
gain: number;
|
|
11
|
+
enhanceGain: number;
|
|
10
12
|
audio: HTMLAudioElement;
|
|
11
13
|
audioContext: AudioContext;
|
|
12
14
|
mediaStreamAudioSourceNode: MediaStreamAudioSourceNode;
|
|
15
|
+
destination: MediaStreamAudioDestinationNode;
|
|
13
16
|
autoGainNode: GainNode;
|
|
14
17
|
biquadFilterNode: BiquadFilterNode;
|
|
15
18
|
delayNode: DelayNode;
|
|
@@ -33,12 +36,16 @@ export declare class AudioMediaContext {
|
|
|
33
36
|
* 静音
|
|
34
37
|
*/
|
|
35
38
|
setMute: (state?: boolean) => void;
|
|
39
|
+
/**
|
|
40
|
+
* 设置音量
|
|
41
|
+
*/
|
|
42
|
+
setGain: () => void;
|
|
36
43
|
/**
|
|
37
44
|
* 设置增强音量
|
|
38
45
|
*/
|
|
39
46
|
setEnhanceGain: (gain: number) => Promise<void>;
|
|
40
47
|
/**
|
|
41
|
-
*
|
|
48
|
+
* 设置基础音量
|
|
42
49
|
*/
|
|
43
50
|
setVolumeGain: (gain: number) => void;
|
|
44
51
|
/**
|
package/dist/types.d.ts
CHANGED
|
@@ -237,3 +237,4 @@ export interface RoomOptions {
|
|
|
237
237
|
*/
|
|
238
238
|
newPublishAutoSubscribe?: boolean;
|
|
239
239
|
}
|
|
240
|
+
export type Report_Log_Type = 'ws_c_timeout' | 'webrtc_c_timeout' | 'webrtc_c_error' | 'join_room_error' | 'publish_error' | 'subscribe_error' | 'close_track_error' | 'heartbeat_e_timeout' | 'heartbeat_i_timeout' | 'quit_room_error';
|