quickvo-sdk-js 0.9.2 → 0.9.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.
@@ -0,0 +1,44 @@
1
+ export declare class NetworkQualityTester {
2
+ targetUrls: string[];
3
+ results: any[];
4
+ constructor(targetUrls?: string[]);
5
+ testAll(): Promise<{
6
+ overallSuccess: boolean;
7
+ message: string;
8
+ totalTests?: undefined;
9
+ successfulTests?: undefined;
10
+ averageDownloadSpeed?: undefined;
11
+ averageResponseTime?: undefined;
12
+ totalDataTransferred?: undefined;
13
+ detailedResults?: undefined;
14
+ } | {
15
+ overallSuccess: boolean;
16
+ totalTests: number;
17
+ successfulTests: number;
18
+ averageDownloadSpeed: string;
19
+ averageResponseTime: string;
20
+ totalDataTransferred: string;
21
+ detailedResults: any[];
22
+ message?: undefined;
23
+ }>;
24
+ testUrl(url: string): Promise<void>;
25
+ analyzeResults(): {
26
+ overallSuccess: boolean;
27
+ message: string;
28
+ totalTests?: undefined;
29
+ successfulTests?: undefined;
30
+ averageDownloadSpeed?: undefined;
31
+ averageResponseTime?: undefined;
32
+ totalDataTransferred?: undefined;
33
+ detailedResults?: undefined;
34
+ } | {
35
+ overallSuccess: boolean;
36
+ totalTests: number;
37
+ successfulTests: number;
38
+ averageDownloadSpeed: string;
39
+ averageResponseTime: string;
40
+ totalDataTransferred: string;
41
+ detailedResults: any[];
42
+ message?: undefined;
43
+ };
44
+ }
@@ -3,6 +3,8 @@ import { QuickOptions, Report_Log_Type, RoomOptions, RoomUser, UserTrack } from
3
3
  import { CallsWebSocket, CallsWebSocketOptions } from './CallsWebSocket';
4
4
  import { K_mediaType } from '../enums/mediaType';
5
5
  import { PrTaskQueue } from 'pr-task-queue';
6
+ import { NetworkQualityTester } from './NetworkQualityTester';
7
+ import { StreamRecorder } from './StreamRecorder';
6
8
  type Options = QuickOptions & RoomOptions & CallsWebSocketOptions & {
7
9
  earlyId?: string;
8
10
  };
@@ -12,15 +14,19 @@ export declare class RoomBase {
12
14
  prohibitNotify: boolean;
13
15
  isEarly: boolean;
14
16
  isInRoom: boolean;
15
- taskQueue: PrTaskQueue<"closeTrack" | "renegotiate" | "subscribe" | "publish" | "joinRoom" | "createWs" | "createSession" | "ice" | "createTrack">;
17
+ taskQueue: PrTaskQueue<"publish" | "subscribe" | "renegotiate" | "closeTrack" | "joinRoom" | "createWs" | "createSession" | "ice" | "createTrack">;
16
18
  roomState: K_roomState;
17
19
  createAt: number;
18
20
  cwsIns: CallsWebSocket;
19
21
  peerIns: RTCPeerConnection;
20
22
  transceiverMap: Map<"microphoneCamera_audio" | "microphoneCamera_video" | "screenSharing_video" | "screenSharing_audio", RTCRtpTransceiver>;
23
+ sendChannel: RTCDataChannel;
24
+ receiveChannel: RTCDataChannel;
21
25
  userMap: Map<string, RoomUser>;
22
26
  setLocalStreamActiveMap: Map<K_mediaType, Boolean>;
23
27
  phoneyStreams: Map<K_mediaType, MediaStream>;
28
+ recorder: StreamRecorder;
29
+ networkQualityTester: NetworkQualityTester;
24
30
  mediaDevicesErrInfo: {
25
31
  microphoneCamera_audio: string;
26
32
  microphoneCamera_video: string;
@@ -32,7 +38,7 @@ export declare class RoomBase {
32
38
  * reportLogs
33
39
  */
34
40
  reportLogs: (_type: Report_Log_Type, describe?: string) => void;
35
- initPhoneyStreams: (audioContext: AudioContext) => void;
41
+ initPhoneyStreams: (audioContext: AudioContext, mediaTypes?: K_mediaType[]) => void;
36
42
  getPhoneyStreams: (mediaType: K_mediaType) => MediaStream;
37
43
  /**
38
44
  * getRoomInfo
@@ -79,6 +85,10 @@ export declare class RoomBase {
79
85
  * getUserMediaKey
80
86
  */
81
87
  getUserMediaKey: (userId: string, mediaType: string) => string;
88
+ /**
89
+ * getCallAction
90
+ */
91
+ getCallAction: (tracks: UserTrack[]) => Promise<number>;
82
92
  /**
83
93
  * getCallActionMap
84
94
  */
@@ -89,13 +99,18 @@ export declare class RoomBase {
89
99
  screenSharing_audio: boolean;
90
100
  };
91
101
  /**
92
- * getAverageVolume
102
+ * getBanBehaviorMap
93
103
  */
94
- getAverageVolume: (analyser: AnalyserNode, dataArray: Uint8Array) => number;
104
+ getBanBehaviorMap: (num?: number) => {
105
+ microphoneCamera_audio: boolean;
106
+ microphoneCamera_video: boolean;
107
+ screenSharing_video: boolean;
108
+ screenSharing_audio: boolean;
109
+ };
95
110
  /**
96
- * getCallAction
111
+ * getAverageVolume
97
112
  */
98
- getCallAction: (tracks: UserTrack[]) => Promise<number>;
113
+ getAverageVolume: (analyser: AnalyserNode, dataArray: Uint8Array) => number;
99
114
  /**
100
115
  * getTrackNamesFormTracks
101
116
  * @param tracks
@@ -102,6 +102,21 @@ export declare class RoomCalls extends RoomPeer {
102
102
  * @example quickvo.inactiveTracks(['microphoneCamera_audio'], false)
103
103
  */
104
104
  inactiveTracks: (mediaTypes: K_mediaType[], enabled: boolean) => Promise<boolean>;
105
+ /**
106
+ * setBanBehaviors
107
+ */
108
+ setBanBehaviors: (usersBehaviors: Array<{
109
+ id: string;
110
+ banBehaviors: { [key in K_mediaType]?: boolean; };
111
+ }>) => Promise<unknown>;
112
+ /**
113
+ * pubChannel
114
+ */
115
+ pubChannel: () => Promise<Boolean>;
116
+ /**
117
+ * subChannel
118
+ */
119
+ subChannel: (userChannels?: any[]) => Promise<Boolean>;
105
120
  debugger: () => Promise<any>;
106
121
  shutdown: () => Promise<any>;
107
122
  initHeartbeat: () => void;
@@ -6,11 +6,17 @@ import { RoomBase } from './RoomBase';
6
6
  export declare class RoomMedias extends RoomBase {
7
7
  #private;
8
8
  localStreamsActionMap: Map<K_mediaType, Boolean>;
9
+ audioContext: AudioContext;
9
10
  constructor(options: QuickOptions);
11
+ initMediaPhoneyStreams: (mediaTypes?: K_mediaType[]) => void;
10
12
  /**
11
- * resume
13
+ * initLocalStreamsFilter
12
14
  */
13
- resume: () => void;
15
+ initLocalStreamsFilter: () => void;
16
+ /**
17
+ * setFilterStream
18
+ */
19
+ setLocalFilterStream: (mediaType: K_mediaType, filterStreamFunc: (old_stream: MediaStream) => Promise<MediaStream>) => void;
14
20
  /**
15
21
  * emitNotifyUpdateUsersStreams
16
22
  */
@@ -58,6 +64,11 @@ export declare class RoomMedias extends RoomBase {
58
64
  * stopLocalStreams
59
65
  */
60
66
  stopLocalStreams: (mediaTypes?: K_mediaType[]) => Promise<void>;
67
+ /**
68
+ * addLocalStream
69
+ * @param mediaType
70
+ * @param stream
71
+ */
61
72
  addLocalStream: (mediaType: K_mediaType, stream: MediaStream) => void;
62
73
  /**
63
74
  * initLocalStream
@@ -66,11 +77,11 @@ export declare class RoomMedias extends RoomBase {
66
77
  /**
67
78
  * getLocalStream
68
79
  */
69
- getLocalStream: (mediaType: K_mediaType) => MediaStream | undefined;
80
+ getLocalStream: (mediaType: K_mediaType) => Promise<MediaStream | undefined>;
70
81
  /**
71
82
  * getLocalStreams
72
83
  */
73
- getLocalStreams: (mediaTypes?: K_mediaType[]) => Streams;
84
+ getLocalStreams: (mediaTypes?: K_mediaType[]) => Promise<Streams>;
74
85
  /**
75
86
  * getMediaDeviceKind
76
87
  * @param mediaDeviceKind "audioinput" | "audiooutput" | "videoinput"
@@ -15,6 +15,14 @@ export declare class RoomPeer extends RoomUsers {
15
15
  };
16
16
  constructor(options: QuickOptions);
17
17
  initPeer: () => void;
18
+ /**
19
+ * initSendChannel
20
+ */
21
+ initSendChannel: (label: string | undefined, id: number) => void;
22
+ /**
23
+ * initReceiveChannel
24
+ */
25
+ initReceiveChannel: (label: string | undefined, id: number) => void;
18
26
  /**
19
27
  * replaceSenderStream
20
28
  */
@@ -77,14 +77,18 @@ export declare class RoomUsers extends RoomMedias {
77
77
  */
78
78
  getUsersId: () => Promise<string[]>;
79
79
  /**
80
- * getCaller
80
+ * getSelfInfo
81
81
  */
82
- getCaller: () => Promise<RoomUser>;
82
+ getSelfInfo: () => Promise<RoomUser>;
83
83
  updateIsPublished: (userId: string, isPublished?: boolean) => Promise<void>;
84
84
  /**
85
85
  * setUserUpdateStreams
86
86
  */
87
87
  setUserUpdateStreams: (userId: string, mediaType: K_mediaType, state?: boolean) => Promise<void>;
88
+ /**
89
+ * updateUserChannels
90
+ */
91
+ updateUserChannels: (userId: string, channels: any[] | undefined, merge: Boolean) => Promise<void>;
88
92
  /**
89
93
  * updateUsertracks
90
94
  */
@@ -93,6 +97,10 @@ export declare class RoomUsers extends RoomMedias {
93
97
  * updateUserCallAction
94
98
  */
95
99
  updateUserCallAction: (userId: string, callAction?: number) => Promise<void>;
100
+ /**
101
+ * updateUserBehaviors
102
+ */
103
+ updateUserBehaviors: (userId: string, banBehavior?: number) => Promise<void>;
96
104
  /**
97
105
  * updateUserNetwork
98
106
  */
@@ -0,0 +1,36 @@
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
+ * getDuration
24
+ */
25
+ getDuration: () => number;
26
+ /**
27
+ * getInfo
28
+ */
29
+ getInfo: () => {
30
+ active: boolean;
31
+ pause: boolean;
32
+ startTime: number;
33
+ endTime: number;
34
+ duration: number;
35
+ };
36
+ }
@@ -6,7 +6,8 @@ export interface UserAudioFilterOptions {
6
6
  export declare class AudioMediaContext {
7
7
  options: UserAudioFilterOptions;
8
8
  kind: "audio";
9
- stream: MediaStream;
9
+ original_stream: MediaStream;
10
+ filterStream: (old_stream: MediaStream) => MediaStream;
10
11
  inputGain: number;
11
12
  outputGain: number;
12
13
  enhanceGain: number;
@@ -17,7 +18,6 @@ export declare class AudioMediaContext {
17
18
  analyserNode: AnalyserNode;
18
19
  analyserArrayData: Uint8Array;
19
20
  outputGainNode: GainNode;
20
- destinationNode: MediaStreamAudioDestinationNode;
21
21
  constructor(track: MediaStreamTrack, audioContext: AudioContext);
22
22
  initNodes: () => void;
23
23
  /**
package/dist/types.d.ts CHANGED
@@ -100,6 +100,19 @@ export interface UserTrack {
100
100
  */
101
101
  settings?: MediaTrackSettings;
102
102
  }
103
+ /**
104
+ * 数据通道
105
+ */
106
+ export interface Channel {
107
+ /**
108
+ * dataChannelName
109
+ */
110
+ dataChannelName: string;
111
+ /**
112
+ * id
113
+ */
114
+ id: number;
115
+ }
103
116
  /**
104
117
  * 事件
105
118
  */
@@ -169,6 +182,14 @@ export interface RoomUser {
169
182
  callActionMap: {
170
183
  [key in K_mediaType]: boolean;
171
184
  };
185
+ /**
186
+ * 禁止行为
187
+ */
188
+ banBehavior: number;
189
+ banBehaviorStr: string;
190
+ banBehaviorMap: {
191
+ [key in K_mediaType]: boolean;
192
+ };
172
193
  /**
173
194
  * 通话行为
174
195
  */
@@ -181,6 +202,10 @@ export interface RoomUser {
181
202
  * 加入时间
182
203
  */
183
204
  joinTime: number;
205
+ /**
206
+ * 是否为房间所有者
207
+ */
208
+ isOwner: boolean;
184
209
  /**
185
210
  * 是否为自己
186
211
  */
@@ -208,6 +233,10 @@ export interface RoomUser {
208
233
  * 用户轨道
209
234
  */
210
235
  tracks: UserTrack[];
236
+ /**
237
+ * 用户数据通道
238
+ */
239
+ channels: Channel[];
211
240
  /**
212
241
  * 是否更新了流
213
242
  */
package/package.json CHANGED
@@ -1,44 +1,49 @@
1
- {
2
- "name": "quickvo-sdk-js",
3
- "description": "提供快捷接入单对单、单对多、群体会议、舞台会议等音视频功能。",
4
- "version": "0.9.2",
5
- "type": "module",
6
- "files": [
7
- "dist"
8
- ],
9
- "main": "./dist/index.umd.cjs",
10
- "module": "./dist/index.js",
11
- "types": "./dist/index.d.ts",
12
- "exports": {
13
- ".": {
14
- "import": "./dist/index.js",
15
- "require": "./dist/index.umd.cjs"
16
- }
17
- },
18
- "scripts": {
19
- "build": "tsc && vite build"
20
- },
21
- "dependencies": {
22
- "pako": "^2.1.0",
23
- "pr-task-queue": "^0.4.4",
24
- "pr-tools": "^1.5.7",
25
- "pr-ws": "^0.2.5",
26
- "sdp-transform": "^2.15.0"
27
- },
28
- "devDependencies": {
29
- "protobufjs": "^7.4.0",
30
- "typescript": "^5.8.2",
31
- "vite": "^6.2.2",
32
- "vite-plugin-bundle-obfuscator": "^1.6.0",
33
- "vite-plugin-dts": "^4.5.3"
34
- },
35
- "private": false,
36
- "author": "Breathe",
37
- "keywords": [
38
- "quickvo-sdk-js"
39
- ],
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/Breathe97/quickvo-sdk-js"
43
- }
44
- }
1
+ {
2
+ "name": "quickvo-sdk-js",
3
+ "description": "提供快捷接入单对单、单对多、群体会议、舞台会议等音视频功能。",
4
+ "version": "0.9.4",
5
+ "type": "module",
6
+ "files": [
7
+ "dist"
8
+ ],
9
+ "main": "./dist/index.umd.cjs",
10
+ "module": "./dist/index.js",
11
+ "types": "./dist/index.d.ts",
12
+ "exports": {
13
+ ".": {
14
+ "import": "./dist/index.js",
15
+ "require": "./dist/index.umd.cjs"
16
+ }
17
+ },
18
+ "scripts": {
19
+ "build": "tsc && vite build"
20
+ },
21
+ "dependencies": {
22
+ "@timecat/player": "1.2.0-alpha.27",
23
+ "@timecat/recorder": "1.2.0-alpha.27",
24
+ "opus-decoder": "^0.7.10",
25
+ "pako": "^2.1.0",
26
+ "pr-task-queue": "^0.4.4",
27
+ "pr-tools": "^1.5.7",
28
+ "pr-ws": "^0.2.5",
29
+ "sdp-transform": "^2.15.0",
30
+ "timecatjs": "1.2.0-alpha.27",
31
+ "webm-duration-fix": "^1.0.4"
32
+ },
33
+ "devDependencies": {
34
+ "protobufjs": "^7.4.0",
35
+ "typescript": "^5.8.2",
36
+ "vite": "^6.2.2",
37
+ "vite-plugin-bundle-obfuscator": "^1.6.0",
38
+ "vite-plugin-dts": "^4.5.3"
39
+ },
40
+ "private": false,
41
+ "author": "Breathe",
42
+ "keywords": [
43
+ "quickvo-sdk-js"
44
+ ],
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/Breathe97/quickvo-sdk-js"
48
+ }
49
+ }