quickvo-sdk-js 0.7.7 → 0.7.8
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/index.js +11 -11
- package/dist/index.umd.cjs +1 -1
- package/dist/room/RoomPeer.d.ts +10 -10
- package/dist/room/mediaStreams/AudioMediaContext.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -784,7 +784,7 @@ class AudioMediaContext {
|
|
|
784
784
|
/**
|
|
785
785
|
* 获取数据流
|
|
786
786
|
*/
|
|
787
|
-
Z(this, "getStream", () => this.
|
|
787
|
+
Z(this, "getStream", () => this.sourceNode.mediaStream);
|
|
788
788
|
/**
|
|
789
789
|
* 静音
|
|
790
790
|
*/
|
|
@@ -8534,10 +8534,6 @@ class RoomPeer extends RoomUsers {
|
|
|
8534
8534
|
}
|
|
8535
8535
|
return await this.peerIns.setRemoteDescription(a), a;
|
|
8536
8536
|
});
|
|
8537
|
-
/**
|
|
8538
|
-
* 获取peer网络情况
|
|
8539
|
-
*/
|
|
8540
|
-
Z(this, "getPeerNetwork", () => this.peerNetwork);
|
|
8541
8537
|
/**
|
|
8542
8538
|
* 设置通讯策略
|
|
8543
8539
|
* @param callStrategy "fixedPictureQuality" | "qualityPriority" | "fluencyPriority" | "balancedDowngrade"
|
|
@@ -8592,12 +8588,16 @@ class RoomPeer extends RoomUsers {
|
|
|
8592
8588
|
* 获取房间网络信息
|
|
8593
8589
|
*/
|
|
8594
8590
|
Z(this, "getRoomNetwork", () => this.peerNetwork);
|
|
8591
|
+
/**
|
|
8592
|
+
* 获取peer网络情况
|
|
8593
|
+
*/
|
|
8594
|
+
Z(this, "getPeerNetwork", () => this.peerNetwork);
|
|
8595
8595
|
/**
|
|
8596
8596
|
* 计算网络质量
|
|
8597
8597
|
*/
|
|
8598
8598
|
at(this, Vt, async () => {
|
|
8599
8599
|
try {
|
|
8600
|
-
const a = await this.peerIns.getStats(), E = ["inbound-rtp", "remote-inbound-rtp", "outbound-rtp"], k = [...a.values()].filter((nt) => E.includes(nt.type));
|
|
8600
|
+
const a = await this.peerIns.getStats(), E = ["inbound-rtp", "remote-inbound-rtp", "outbound-rtp", "transport"], k = [...a.values()].filter((nt) => E.includes(nt.type));
|
|
8601
8601
|
let e = 0, n = 0, O = 0, $ = 0, N = 0, D = 0, q = [], P = [];
|
|
8602
8602
|
for (const nt of this.reports) {
|
|
8603
8603
|
const { packetsSent: ut, packetsLost: it } = nt;
|
|
@@ -8605,11 +8605,11 @@ class RoomPeer extends RoomUsers {
|
|
|
8605
8605
|
}
|
|
8606
8606
|
this.reports = k;
|
|
8607
8607
|
for (const nt of this.reports) {
|
|
8608
|
-
const {
|
|
8609
|
-
ut && (
|
|
8608
|
+
const { bytesSent: ut, bytesReceived: it, packetsSent: lt, packetsLost: st, roundTripTime: rt, jitter: ct } = nt;
|
|
8609
|
+
ut && (n = ut), it && (e = it), lt && (N += lt), st && (D += st), rt && q.push((rt * 100).toFixed(2)), ct && P.push(ct.toFixed(2));
|
|
8610
8610
|
}
|
|
8611
8611
|
P.sort().reverse(), q.sort().reverse();
|
|
8612
|
-
const j = N - O, V = D - $, J = j === 0 ? "0.00" : (V / j).toFixed(2), [z = "0"] = q, [Y = "0"] = P, et = {
|
|
8612
|
+
const j = N - O, V = D - $, J = j === 0 ? "0.00" : (V / j).toFixed(2), [z = "0"] = q, [Y = "0"] = P, et = { outboundBytes: n, inboundBytes: e, lostRate: J, roundTripTime: z, jitter: Y };
|
|
8613
8613
|
this.peerNetwork = et;
|
|
8614
8614
|
const tt = (nt, ut, it) => {
|
|
8615
8615
|
const lt = Number(nt), st = Number(ut), rt = Number(it);
|
|
@@ -8827,7 +8827,6 @@ class RoomCalls extends RoomPeer {
|
|
|
8827
8827
|
z == null || z.replaceStream(J), V && await this.replaceSenderStream([q], !0);
|
|
8828
8828
|
}
|
|
8829
8829
|
}
|
|
8830
|
-
this.options.debug && console.log("\x1B[38;2;0;151;255m%c%s\x1B[0m", "color:#0097ff;", "------->quickvo: setMediaDeviceKind", { mediaType: q, isOpen: P, hadTrack: j, isActive: V });
|
|
8831
8830
|
{
|
|
8832
8831
|
const J = this.getLocalStreams(N);
|
|
8833
8832
|
this.cwsIns.emitNotify("onLocalStream", { code: 200, data: J, desc: "local stream is change." }), _(!0);
|
|
@@ -8869,7 +8868,8 @@ class RoomCalls extends RoomPeer {
|
|
|
8869
8868
|
const { roomId: O, userId: $, callType: N } = this.options;
|
|
8870
8869
|
this.cwsIns.sendMessage({
|
|
8871
8870
|
event: this.isEarly ? "joinRoomEx" : "joinRoom",
|
|
8872
|
-
data: { callType: N, roomId: O, user: { id: $, tracks: [], callAction: 0 } }
|
|
8871
|
+
data: { callType: N, roomId: O, user: { id: $, tracks: [], callAction: 0 } },
|
|
8872
|
+
version: 2
|
|
8873
8873
|
}).then(async (D) => {
|
|
8874
8874
|
const { code: q = 0, desc: P = "服务器繁忙", data: j } = D;
|
|
8875
8875
|
if (q !== 200) return _(P);
|