@whereby.com/media 8.3.0 → 8.3.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/dist/index.cjs +6 -6
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +6 -6
- package/dist/legacy-esm.js +6 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1483,7 +1483,7 @@ let numFailedTrackSsrcLookups = 0;
|
|
|
1483
1483
|
const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promise.all(getCurrentPeerConnections().map((pc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1484
1484
|
let pcData = pcDataByPc.get(pc);
|
|
1485
1485
|
if (!pcData) {
|
|
1486
|
-
pcData = { ssrcToTrackId: {} };
|
|
1486
|
+
pcData = { ssrcToTrackId: {}, currentSSRCs: {} };
|
|
1487
1487
|
pcDataByPc.set(pc, pcData);
|
|
1488
1488
|
}
|
|
1489
1489
|
try {
|
|
@@ -1533,7 +1533,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1533
1533
|
}
|
|
1534
1534
|
});
|
|
1535
1535
|
}
|
|
1536
|
-
return
|
|
1536
|
+
return { pc, report, pcData };
|
|
1537
1537
|
}
|
|
1538
1538
|
catch (e) {
|
|
1539
1539
|
rtcStats.sendEvent("trackSsrcLookupFailed", {
|
|
@@ -1542,7 +1542,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1542
1542
|
message: e === null || e === void 0 ? void 0 : e.message,
|
|
1543
1543
|
});
|
|
1544
1544
|
numFailedTrackSsrcLookups++;
|
|
1545
|
-
return
|
|
1545
|
+
return { pc, report: new Map(), pcData };
|
|
1546
1546
|
}
|
|
1547
1547
|
})));
|
|
1548
1548
|
|
|
@@ -1622,7 +1622,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1622
1622
|
return;
|
|
1623
1623
|
}
|
|
1624
1624
|
state.lastUpdateTime = Date.now();
|
|
1625
|
-
(yield getPeerConnectionsWithStatsReports()).forEach((
|
|
1625
|
+
(yield getPeerConnectionsWithStatsReports()).forEach(({ pc, report, pcData }) => {
|
|
1626
1626
|
const pcIndex = getPeerConnectionIndex(pc);
|
|
1627
1627
|
if (pcIndex === undefined) {
|
|
1628
1628
|
logger.warn("Could not find index for PeerConnection");
|
|
@@ -1631,7 +1631,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1631
1631
|
report = new Map();
|
|
1632
1632
|
removePeerConnection(pc);
|
|
1633
1633
|
}
|
|
1634
|
-
pcData.previousSSRCs = pcData.currentSSRCs
|
|
1634
|
+
pcData.previousSSRCs = pcData.currentSSRCs;
|
|
1635
1635
|
pcData.currentSSRCs = {};
|
|
1636
1636
|
report.forEach((currentRtcStats) => {
|
|
1637
1637
|
var _a, _b;
|
|
@@ -1669,7 +1669,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1669
1669
|
pcData.ssrcToTrackId[ssrc] = clientTrack.id;
|
|
1670
1670
|
}
|
|
1671
1671
|
pcData.currentSSRCs[ssrc] = client.id;
|
|
1672
|
-
if (prevRtcStats) {
|
|
1672
|
+
if (prevRtcStats && pcData._oldReport) {
|
|
1673
1673
|
const newTransport = report.get(currentRtcStats.transportId);
|
|
1674
1674
|
const oldTransport = pcData._oldReport.get(prevRtcStats.transportId);
|
|
1675
1675
|
if (oldTransport &&
|
package/dist/index.d.cts
CHANGED
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1462,7 +1462,7 @@ let numFailedTrackSsrcLookups = 0;
|
|
|
1462
1462
|
const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promise.all(getCurrentPeerConnections().map((pc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1463
1463
|
let pcData = pcDataByPc.get(pc);
|
|
1464
1464
|
if (!pcData) {
|
|
1465
|
-
pcData = { ssrcToTrackId: {} };
|
|
1465
|
+
pcData = { ssrcToTrackId: {}, currentSSRCs: {} };
|
|
1466
1466
|
pcDataByPc.set(pc, pcData);
|
|
1467
1467
|
}
|
|
1468
1468
|
try {
|
|
@@ -1512,7 +1512,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1512
1512
|
}
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
1515
|
-
return
|
|
1515
|
+
return { pc, report, pcData };
|
|
1516
1516
|
}
|
|
1517
1517
|
catch (e) {
|
|
1518
1518
|
rtcStats.sendEvent("trackSsrcLookupFailed", {
|
|
@@ -1521,7 +1521,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1521
1521
|
message: e === null || e === void 0 ? void 0 : e.message,
|
|
1522
1522
|
});
|
|
1523
1523
|
numFailedTrackSsrcLookups++;
|
|
1524
|
-
return
|
|
1524
|
+
return { pc, report: new Map(), pcData };
|
|
1525
1525
|
}
|
|
1526
1526
|
})));
|
|
1527
1527
|
|
|
@@ -1601,7 +1601,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1601
1601
|
return;
|
|
1602
1602
|
}
|
|
1603
1603
|
state.lastUpdateTime = Date.now();
|
|
1604
|
-
(yield getPeerConnectionsWithStatsReports()).forEach((
|
|
1604
|
+
(yield getPeerConnectionsWithStatsReports()).forEach(({ pc, report, pcData }) => {
|
|
1605
1605
|
const pcIndex = getPeerConnectionIndex(pc);
|
|
1606
1606
|
if (pcIndex === undefined) {
|
|
1607
1607
|
logger.warn("Could not find index for PeerConnection");
|
|
@@ -1610,7 +1610,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1610
1610
|
report = new Map();
|
|
1611
1611
|
removePeerConnection(pc);
|
|
1612
1612
|
}
|
|
1613
|
-
pcData.previousSSRCs = pcData.currentSSRCs
|
|
1613
|
+
pcData.previousSSRCs = pcData.currentSSRCs;
|
|
1614
1614
|
pcData.currentSSRCs = {};
|
|
1615
1615
|
report.forEach((currentRtcStats) => {
|
|
1616
1616
|
var _a, _b;
|
|
@@ -1648,7 +1648,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1648
1648
|
pcData.ssrcToTrackId[ssrc] = clientTrack.id;
|
|
1649
1649
|
}
|
|
1650
1650
|
pcData.currentSSRCs[ssrc] = client.id;
|
|
1651
|
-
if (prevRtcStats) {
|
|
1651
|
+
if (prevRtcStats && pcData._oldReport) {
|
|
1652
1652
|
const newTransport = report.get(currentRtcStats.transportId);
|
|
1653
1653
|
const oldTransport = pcData._oldReport.get(prevRtcStats.transportId);
|
|
1654
1654
|
if (oldTransport &&
|
package/dist/legacy-esm.js
CHANGED
|
@@ -1462,7 +1462,7 @@ let numFailedTrackSsrcLookups = 0;
|
|
|
1462
1462
|
const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promise.all(getCurrentPeerConnections().map((pc) => __awaiter(void 0, void 0, void 0, function* () {
|
|
1463
1463
|
let pcData = pcDataByPc.get(pc);
|
|
1464
1464
|
if (!pcData) {
|
|
1465
|
-
pcData = { ssrcToTrackId: {} };
|
|
1465
|
+
pcData = { ssrcToTrackId: {}, currentSSRCs: {} };
|
|
1466
1466
|
pcDataByPc.set(pc, pcData);
|
|
1467
1467
|
}
|
|
1468
1468
|
try {
|
|
@@ -1512,7 +1512,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1512
1512
|
}
|
|
1513
1513
|
});
|
|
1514
1514
|
}
|
|
1515
|
-
return
|
|
1515
|
+
return { pc, report, pcData };
|
|
1516
1516
|
}
|
|
1517
1517
|
catch (e) {
|
|
1518
1518
|
rtcStats.sendEvent("trackSsrcLookupFailed", {
|
|
@@ -1521,7 +1521,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
|
|
|
1521
1521
|
message: e === null || e === void 0 ? void 0 : e.message,
|
|
1522
1522
|
});
|
|
1523
1523
|
numFailedTrackSsrcLookups++;
|
|
1524
|
-
return
|
|
1524
|
+
return { pc, report: new Map(), pcData };
|
|
1525
1525
|
}
|
|
1526
1526
|
})));
|
|
1527
1527
|
|
|
@@ -1601,7 +1601,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1601
1601
|
return;
|
|
1602
1602
|
}
|
|
1603
1603
|
state.lastUpdateTime = Date.now();
|
|
1604
|
-
(yield getPeerConnectionsWithStatsReports()).forEach((
|
|
1604
|
+
(yield getPeerConnectionsWithStatsReports()).forEach(({ pc, report, pcData }) => {
|
|
1605
1605
|
const pcIndex = getPeerConnectionIndex(pc);
|
|
1606
1606
|
if (pcIndex === undefined) {
|
|
1607
1607
|
logger.warn("Could not find index for PeerConnection");
|
|
@@ -1610,7 +1610,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1610
1610
|
report = new Map();
|
|
1611
1611
|
removePeerConnection(pc);
|
|
1612
1612
|
}
|
|
1613
|
-
pcData.previousSSRCs = pcData.currentSSRCs
|
|
1613
|
+
pcData.previousSSRCs = pcData.currentSSRCs;
|
|
1614
1614
|
pcData.currentSSRCs = {};
|
|
1615
1615
|
report.forEach((currentRtcStats) => {
|
|
1616
1616
|
var _a, _b;
|
|
@@ -1648,7 +1648,7 @@ function collectStats(state_1, _a, immediate_1) {
|
|
|
1648
1648
|
pcData.ssrcToTrackId[ssrc] = clientTrack.id;
|
|
1649
1649
|
}
|
|
1650
1650
|
pcData.currentSSRCs[ssrc] = client.id;
|
|
1651
|
-
if (prevRtcStats) {
|
|
1651
|
+
if (prevRtcStats && pcData._oldReport) {
|
|
1652
1652
|
const newTransport = report.get(currentRtcStats.transportId);
|
|
1653
1653
|
const oldTransport = pcData._oldReport.get(prevRtcStats.transportId);
|
|
1654
1654
|
if (oldTransport &&
|