quickvo-sdk-js 1.6.79 → 1.7.0
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/chunk-CsPFSEoR.js +60 -0
- package/dist/index.js +18627 -18788
- package/dist/index.umd.cjs +4 -4
- package/dist/lib-CzTuQ1jO.js +11120 -0
- package/dist/src/QuickVO.d.ts +0 -2
- package/dist/src/action/ActionSFU.d.ts +1 -13
- package/dist/src/base/modules/Config.d.ts +8 -8
- package/dist/src/base/modules/cws/CallsWebSocket.d.ts +7 -0
- package/dist/src/protos/gen/Room_pb.d.ts +10 -0
- package/dist/src/protos/protoEvent.d.ts +50 -11
- package/dist/src/workers/protos/WorkerCore.d.ts +13 -1
- package/dist/src/workers/protos/types.d.ts +6 -4
- package/package.json +1 -1
- package/dist/chunk-DA-GsYlW.js +0 -57
- package/dist/lib-D54d8Ctq.js +0 -11181
package/dist/src/QuickVO.d.ts
CHANGED
|
@@ -51,7 +51,6 @@ export declare class QuickVO {
|
|
|
51
51
|
setLocalStream: (mediaTypes: import('./enums').K_mediaType[], active: boolean) => Promise<void>;
|
|
52
52
|
setMediaDeviceKind: (mediaDeviceKind: MediaDeviceKind, deviceId: string | undefined) => Promise<void>;
|
|
53
53
|
setMediaTrackConstraints: (mediaType: import('./enums').K_mediaType, constraints: MediaTrackConstraints) => Promise<void>;
|
|
54
|
-
earlyConnect: (entirely?: boolean) => Promise<true | undefined>;
|
|
55
54
|
joinRoom: (roomOptions: import('./types').RoomOptions) => Promise<string>;
|
|
56
55
|
publish: (mediaTypes: import('./enums').K_mediaType[]) => Promise<true>;
|
|
57
56
|
stopPublish: (mediaTypes: import('./enums').K_mediaType[]) => Promise<true>;
|
|
@@ -69,7 +68,6 @@ export declare class QuickVO {
|
|
|
69
68
|
}) => void;
|
|
70
69
|
updateToken: (sdkToken: string) => void;
|
|
71
70
|
quitRoom: () => Promise<string>;
|
|
72
|
-
quitRoomEx: () => Promise<string>;
|
|
73
71
|
destroy: () => Promise<void>;
|
|
74
72
|
addRequestAnimationFrame: (key: string, func: FrameRequestCallback, options?: {
|
|
75
73
|
fps?: number;
|
|
@@ -4,7 +4,6 @@ import { Base } from '../base/Base';
|
|
|
4
4
|
export declare class ActionSFU {
|
|
5
5
|
base: Base;
|
|
6
6
|
private _onOnline?;
|
|
7
|
-
private _entirely;
|
|
8
7
|
private _reconnectTimerId?;
|
|
9
8
|
/** 网络计算是否进行中,用于避免与 interval 重叠执行 */
|
|
10
9
|
private _networkCalculating;
|
|
@@ -15,7 +14,6 @@ export declare class ActionSFU {
|
|
|
15
14
|
/** 避免 Math.max(...arr) 在极大数组上触达引擎参数长度限制 */
|
|
16
15
|
private static _maxInNumberArray;
|
|
17
16
|
private static _minInNumberArray;
|
|
18
|
-
private _earlyConnectTask;
|
|
19
17
|
private _cwsConnectTask;
|
|
20
18
|
private _connectCFTask;
|
|
21
19
|
private _publishTask;
|
|
@@ -47,11 +45,6 @@ export declare class ActionSFU {
|
|
|
47
45
|
* @param constraints MediaTrackConstraints
|
|
48
46
|
*/
|
|
49
47
|
setMediaTrackConstraints: (mediaType: K_mediaType, constraints: MediaTrackConstraints) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* earlyConnect
|
|
52
|
-
* @param mediaTypes ("mc_audio" | "mc_video" | "ss_video" | "ss_audio")[]
|
|
53
|
-
*/
|
|
54
|
-
earlyConnect: (entirely?: boolean) => Promise<true | undefined>;
|
|
55
48
|
/**
|
|
56
49
|
* joinRoom
|
|
57
50
|
* @param roomOptions RoomOptions
|
|
@@ -90,12 +83,6 @@ export declare class ActionSFU {
|
|
|
90
83
|
* @returns Promise<boolean>
|
|
91
84
|
*/
|
|
92
85
|
quitRoom: () => Promise<string>;
|
|
93
|
-
/**
|
|
94
|
-
* quitRoom and continuously open the connection
|
|
95
|
-
* @example quickvo.quitRoomEx()
|
|
96
|
-
* @returns Promise<boolean>
|
|
97
|
-
*/
|
|
98
|
-
quitRoomEx: () => Promise<string>;
|
|
99
86
|
/**
|
|
100
87
|
* setBanBehaviors
|
|
101
88
|
* @param usersBehaviors Array<{ id: string; banBehaviors: { [key in K_mediaType]?: boolean } }>
|
|
@@ -133,6 +120,7 @@ export declare class ActionSFU {
|
|
|
133
120
|
/** 向服务端拉取 TURN/STUN 配置;失败或未返回有效 iceServers 时返回 undefined,由 Peer 回退默认 STUN */
|
|
134
121
|
private _fetchGenTurnAddress;
|
|
135
122
|
private _refreshTurnViaSetConfiguration;
|
|
123
|
+
private _connectCFByHttp;
|
|
136
124
|
private _connectCF;
|
|
137
125
|
private _reportNetwork;
|
|
138
126
|
private _createTracks;
|
|
@@ -78,21 +78,21 @@ export declare class Config {
|
|
|
78
78
|
*/
|
|
79
79
|
peerState: RTCPeerConnectionState;
|
|
80
80
|
/**
|
|
81
|
-
* sdk
|
|
81
|
+
* sdk服务基础版本号
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
serviceBaseVersion: string;
|
|
84
84
|
/**
|
|
85
|
-
*
|
|
85
|
+
* sdk服务端事件版本号
|
|
86
86
|
*/
|
|
87
|
-
|
|
87
|
+
serviceEventVersion: string;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* call 凭证
|
|
90
90
|
*/
|
|
91
|
-
|
|
91
|
+
callSession: string;
|
|
92
92
|
/**
|
|
93
|
-
*
|
|
93
|
+
* 分片ID
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
shardId: string;
|
|
96
96
|
/**
|
|
97
97
|
* 是否在房间内
|
|
98
98
|
*/
|
|
@@ -4,11 +4,13 @@ import { Config } from '../Config';
|
|
|
4
4
|
import { PrWebSocket } from './PrWebSocket';
|
|
5
5
|
import { WorkerProtos } from '../../../workers/protos';
|
|
6
6
|
import { MessageNotifys } from '../../../protos/protoEvent';
|
|
7
|
+
import { PrResolves } from '../PrResolves';
|
|
7
8
|
type EventsItems = Map<number, CallsWebSocketEvent<any>>;
|
|
8
9
|
type Events = Map<K_eventName, EventsItems>;
|
|
9
10
|
interface On {
|
|
10
11
|
state?: (state: 'connecting' | 'connected' | 'reconnecting' | 'closed') => void;
|
|
11
12
|
log?: (e: unknown) => void;
|
|
13
|
+
updateSeverTime?: (e: MessageNotifys<'updateSeverTime'>) => void;
|
|
12
14
|
onJoinRoom?: (e: MessageNotifys<'onJoinRoom'>) => void;
|
|
13
15
|
onJoinRoomBatch?: (e: MessageNotifys<'onJoinRoomBatch'>) => void;
|
|
14
16
|
onQuitRoom?: (e: MessageNotifys<'onQuitRoom'>) => void;
|
|
@@ -34,6 +36,7 @@ interface On {
|
|
|
34
36
|
onAttemptP2PEx?: (e: MessageNotifys<'onAttemptP2PEx'>) => void;
|
|
35
37
|
onRtcStats?: (e: MessageNotifys<'onRtcStats'>) => void;
|
|
36
38
|
onDisconnectedP2P?: (e: MessageNotifys<'onDisconnectedP2P'>) => void;
|
|
39
|
+
onDestroyRoom?: (e: MessageNotifys<'onDestroyRoom'>) => void;
|
|
37
40
|
}
|
|
38
41
|
export declare class CallsWebSocket {
|
|
39
42
|
config: Config;
|
|
@@ -46,6 +49,10 @@ export declare class CallsWebSocket {
|
|
|
46
49
|
private _logBuffer;
|
|
47
50
|
private _logFlushTimer;
|
|
48
51
|
private static _LOG_FLUSH_DELAY;
|
|
52
|
+
prResolves: PrResolves<"cwsConnected">;
|
|
53
|
+
waitings: {
|
|
54
|
+
cwsConnected: () => Promise<unknown>;
|
|
55
|
+
};
|
|
49
56
|
constructor({ config }: {
|
|
50
57
|
config: Config;
|
|
51
58
|
});
|
|
@@ -262,6 +262,12 @@ export type JoinRsp = Message<"com.quick.voice.proto.JoinRsp"> & {
|
|
|
262
262
|
* @generated from field: optional com.quick.voice.proto.MeetRolesListRsp meetSpecialRoles = 7;
|
|
263
263
|
*/
|
|
264
264
|
meetSpecialRoles?: MeetRolesListRsp;
|
|
265
|
+
/**
|
|
266
|
+
* for reconnect
|
|
267
|
+
*
|
|
268
|
+
* @generated from field: optional string shardId = 8;
|
|
269
|
+
*/
|
|
270
|
+
shardId?: string;
|
|
265
271
|
};
|
|
266
272
|
/**
|
|
267
273
|
* Describes the message com.quick.voice.proto.JoinRsp.
|
|
@@ -752,6 +758,10 @@ export type UpdateTime = Message<"com.quick.voice.proto.UpdateTime"> & {
|
|
|
752
758
|
* @generated from field: int64 time = 1;
|
|
753
759
|
*/
|
|
754
760
|
time: bigint;
|
|
761
|
+
/**
|
|
762
|
+
* @generated from field: string versionStr = 2;
|
|
763
|
+
*/
|
|
764
|
+
versionStr: string;
|
|
755
765
|
};
|
|
756
766
|
/**
|
|
757
767
|
* Describes the message com.quick.voice.proto.UpdateTime.
|
|
@@ -53,6 +53,7 @@ type OnMessageDataMap = {
|
|
|
53
53
|
subscribe: Room.SubscribeRsp;
|
|
54
54
|
closeTrack: Room.CloseTrackRsp;
|
|
55
55
|
syncRoomInfo: Room.SyncRoomInfoRsp;
|
|
56
|
+
updateSeverTime: Room.UpdateTime;
|
|
56
57
|
onDataChannelPublish: Room.UserChannel;
|
|
57
58
|
onJoinRoom: Room.JoinNotify;
|
|
58
59
|
onJoinRoomBatch: Room.JoinBatchNotify;
|
|
@@ -183,17 +184,55 @@ export interface MessageRsp<T extends K_eventName> {
|
|
|
183
184
|
*/
|
|
184
185
|
version: number;
|
|
185
186
|
}
|
|
186
|
-
export declare const encMsg: <T extends K_eventName>(message: MessageReq<T>) =>
|
|
187
|
+
export declare const encMsg: <T extends K_eventName>(message: MessageReq<T>) => {
|
|
188
|
+
res: Uint8Array<ArrayBuffer>;
|
|
189
|
+
req: {
|
|
190
|
+
encBeforSize: number;
|
|
191
|
+
encAfterSize: number;
|
|
192
|
+
/**
|
|
193
|
+
* 事件名称
|
|
194
|
+
*/
|
|
195
|
+
event: T;
|
|
196
|
+
/**
|
|
197
|
+
* 事件数据
|
|
198
|
+
*/
|
|
199
|
+
data: EventDataReqs[T];
|
|
200
|
+
/**
|
|
201
|
+
* 请求时间戳
|
|
202
|
+
*/
|
|
203
|
+
time: number;
|
|
204
|
+
/**
|
|
205
|
+
* 唯一标识
|
|
206
|
+
*/
|
|
207
|
+
sn: number;
|
|
208
|
+
/**
|
|
209
|
+
* 是否压缩数据
|
|
210
|
+
*/
|
|
211
|
+
compress: boolean;
|
|
212
|
+
/**
|
|
213
|
+
* 有效时长
|
|
214
|
+
*/
|
|
215
|
+
valid: number;
|
|
216
|
+
/**
|
|
217
|
+
* 接口版本
|
|
218
|
+
*/
|
|
219
|
+
version: number;
|
|
220
|
+
};
|
|
221
|
+
};
|
|
187
222
|
export declare const decMsg: (buffer: ArrayBuffer) => {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
223
|
+
res: {
|
|
224
|
+
event: string;
|
|
225
|
+
data: any;
|
|
226
|
+
sn: number;
|
|
227
|
+
time: number;
|
|
228
|
+
decBeforSize: number;
|
|
229
|
+
decAfterSize: number;
|
|
230
|
+
code: number;
|
|
231
|
+
desc: string;
|
|
232
|
+
compress: boolean;
|
|
233
|
+
valid: number;
|
|
234
|
+
version: number;
|
|
235
|
+
};
|
|
236
|
+
req: ArrayBuffer;
|
|
198
237
|
};
|
|
199
238
|
export {};
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
import { encMsg } from '../../protos/protoEvent';
|
|
1
2
|
import { On } from './types';
|
|
2
3
|
export declare class WorkerCore {
|
|
3
4
|
on: On;
|
|
5
|
+
/** 待编码消息队列 */
|
|
6
|
+
encodePaddings: Parameters<typeof encMsg>[0][];
|
|
7
|
+
/** 待解码二进制队列 */
|
|
8
|
+
decodePaddings: ArrayBuffer[];
|
|
9
|
+
private encodeFlushScheduled;
|
|
10
|
+
private decodeFlushScheduled;
|
|
11
|
+
private destroyed;
|
|
4
12
|
init: () => void;
|
|
5
|
-
encode: (data:
|
|
13
|
+
encode: (data: Parameters<typeof encMsg>[0]) => void;
|
|
6
14
|
decode: (data: ArrayBuffer) => void;
|
|
15
|
+
private scheduleEncodeFlush;
|
|
16
|
+
private scheduleDecodeFlush;
|
|
17
|
+
private drainEncode;
|
|
18
|
+
private drainDecode;
|
|
7
19
|
destroy: () => void;
|
|
8
20
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export interface On {
|
|
2
2
|
encode?: (result: {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
res: Uint8Array<ArrayBuffer>;
|
|
4
|
+
req: any;
|
|
5
|
+
}) => void;
|
|
6
|
+
decode?: (result: {
|
|
7
|
+
res: any;
|
|
8
|
+
req: any;
|
|
6
9
|
}) => void;
|
|
7
|
-
decode?: (result: Record<string, any>) => void;
|
|
8
10
|
}
|
package/package.json
CHANGED
package/dist/chunk-DA-GsYlW.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var e = n;
|
|
2
|
-
function t() {
|
|
3
|
-
var e = /* @__PURE__ */ "hasOwnProperty.546768lNUunk.enumerable.call.__esModule.356974iKHKyK.bind.default.260180BaSwFx.1505412lhJloG.exports.8prLJnH.getOwnPropertyNames.5BhmEpv.60963halfVq.toStringTag.object.2dGgJuk.prototype.YYhdy.defineProperty.JdZmV.751900PdLaXj.jYMDV.241185UIuaBQ.LNCgM.JbBvx".split(".");
|
|
4
|
-
return t = function() {
|
|
5
|
-
return e;
|
|
6
|
-
}, t();
|
|
7
|
-
}
|
|
8
|
-
(function(e, t) {
|
|
9
|
-
for (var r = n, i = e();;) try {
|
|
10
|
-
if (-parseInt(r(382)) / 1 * (-parseInt(r(367)) / 2) + -parseInt(r(374)) / 3 + -parseInt(r(372)) / 4 + parseInt(r(363)) / 5 * (parseInt(r(359)) / 6) + parseInt(r(364)) / 7 + -parseInt(r(361)) / 8 * (-parseInt(r(378)) / 9) + -parseInt(r(385)) / 10 === t) break;
|
|
11
|
-
i.push(i.shift());
|
|
12
|
-
} catch {
|
|
13
|
-
i.push(i.shift());
|
|
14
|
-
}
|
|
15
|
-
})(t, 382949);
|
|
16
|
-
function n(e, n) {
|
|
17
|
-
return e -= 359, t()[e];
|
|
18
|
-
}
|
|
19
|
-
var r = Object.create, i = Object[e(370)], a = Object.getOwnPropertyDescriptor, o = Object[e(362)], s = Object.getPrototypeOf, c = Object[e(368)][e(377)], l = (t, n) => () => (n || t((n = { exports: {} })[e(360)], n), n.exports), u = (t, n) => {
|
|
20
|
-
var r = e, a = {
|
|
21
|
-
YYhdy: function(e, t, n, r) {
|
|
22
|
-
return e(t, n, r);
|
|
23
|
-
},
|
|
24
|
-
JdZmV: "Module"
|
|
25
|
-
};
|
|
26
|
-
let o = {};
|
|
27
|
-
for (var s in t) a[r(369)](i, o, s, {
|
|
28
|
-
get: t[s],
|
|
29
|
-
enumerable: !0
|
|
30
|
-
});
|
|
31
|
-
return !n && a[r(369)](i, o, Symbol[r(365)], { value: a[r(371)] }), o;
|
|
32
|
-
}, d = (t, n, r, s) => {
|
|
33
|
-
var l = e, u = {
|
|
34
|
-
jYMDV: function(e, t) {
|
|
35
|
-
return e === t;
|
|
36
|
-
},
|
|
37
|
-
ZwGqE: l(366),
|
|
38
|
-
LNCgM: function(e, t) {
|
|
39
|
-
return e === t;
|
|
40
|
-
},
|
|
41
|
-
JbBvx: function(e, t) {
|
|
42
|
-
return e !== t;
|
|
43
|
-
},
|
|
44
|
-
TMyIT: function(e, t, n) {
|
|
45
|
-
return e(t, n);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
if (n && u[l(373)](typeof n, u.ZwGqE) || u[l(375)](typeof n, "function")) for (var d = o(n), f = 0, p = d.length, m; f < p; f++) m = d[f], !c[l(380)](t, m) && u[l(376)](m, r) && i(t, m, {
|
|
49
|
-
get: ((e) => n[e])[l(383)](null, m),
|
|
50
|
-
enumerable: !(s = u.TMyIT(a, n, m)) || s[l(379)]
|
|
51
|
-
});
|
|
52
|
-
return t;
|
|
53
|
-
}, f = (t, n, a) => (a = t == null ? {} : r(s(t)), d(n || !t || !t[e(381)] ? i(a, e(384), {
|
|
54
|
-
value: t,
|
|
55
|
-
enumerable: !0
|
|
56
|
-
}) : a, t));
|
|
57
|
-
export { u as n, f as r, l as t };
|