@whereby.com/media 8.2.8 → 8.3.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/index.cjs CHANGED
@@ -1473,7 +1473,7 @@ if (window.RTCPeerConnection) {
1473
1473
  PatchedRTCPeerConnection.prototype = OriginalRTCPeerConnection.prototype;
1474
1474
  window.RTCPeerConnection = PatchedRTCPeerConnection;
1475
1475
  }
1476
- const getCurrentPeerConnections = () => peerConnections;
1476
+ const getCurrentPeerConnections = () => peerConnections.filter((p) => p.connectionState !== "closed");
1477
1477
  const getPeerConnectionIndex = (pc) => { var _a; return (_a = peerConnectionData.get(pc)) === null || _a === void 0 ? void 0 : _a.index; };
1478
1478
  const setPeerConnectionsForTests = (pcs) => (peerConnections = pcs);
1479
1479
 
@@ -1517,7 +1517,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1517
1517
  }
1518
1518
  });
1519
1519
  if (missingSsrcs) {
1520
- const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()];
1520
+ const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()].filter((o) => o.track);
1521
1521
  const reports = yield Promise.all(sendersAndReceivers.map((o) => o.getStats()));
1522
1522
  reports.forEach((tReport, index) => {
1523
1523
  tReport.forEach((stats) => {
@@ -1527,8 +1527,8 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1527
1527
  });
1528
1528
  });
1529
1529
  missingSsrcs.forEach((ssrc) => {
1530
- numMissingTrackSsrcLookups++;
1531
1530
  if (!pcData.ssrcToTrackId[ssrc]) {
1531
+ numMissingTrackSsrcLookups++;
1532
1532
  pcData.ssrcToTrackId[ssrc] = "?" + ssrc;
1533
1533
  }
1534
1534
  });
package/dist/index.mjs CHANGED
@@ -1452,7 +1452,7 @@ if (window.RTCPeerConnection) {
1452
1452
  PatchedRTCPeerConnection.prototype = OriginalRTCPeerConnection.prototype;
1453
1453
  window.RTCPeerConnection = PatchedRTCPeerConnection;
1454
1454
  }
1455
- const getCurrentPeerConnections = () => peerConnections;
1455
+ const getCurrentPeerConnections = () => peerConnections.filter((p) => p.connectionState !== "closed");
1456
1456
  const getPeerConnectionIndex = (pc) => { var _a; return (_a = peerConnectionData.get(pc)) === null || _a === void 0 ? void 0 : _a.index; };
1457
1457
  const setPeerConnectionsForTests = (pcs) => (peerConnections = pcs);
1458
1458
 
@@ -1496,7 +1496,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1496
1496
  }
1497
1497
  });
1498
1498
  if (missingSsrcs) {
1499
- const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()];
1499
+ const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()].filter((o) => o.track);
1500
1500
  const reports = yield Promise.all(sendersAndReceivers.map((o) => o.getStats()));
1501
1501
  reports.forEach((tReport, index) => {
1502
1502
  tReport.forEach((stats) => {
@@ -1506,8 +1506,8 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1506
1506
  });
1507
1507
  });
1508
1508
  missingSsrcs.forEach((ssrc) => {
1509
- numMissingTrackSsrcLookups++;
1510
1509
  if (!pcData.ssrcToTrackId[ssrc]) {
1510
+ numMissingTrackSsrcLookups++;
1511
1511
  pcData.ssrcToTrackId[ssrc] = "?" + ssrc;
1512
1512
  }
1513
1513
  });
@@ -1452,7 +1452,7 @@ if (window.RTCPeerConnection) {
1452
1452
  PatchedRTCPeerConnection.prototype = OriginalRTCPeerConnection.prototype;
1453
1453
  window.RTCPeerConnection = PatchedRTCPeerConnection;
1454
1454
  }
1455
- const getCurrentPeerConnections = () => peerConnections;
1455
+ const getCurrentPeerConnections = () => peerConnections.filter((p) => p.connectionState !== "closed");
1456
1456
  const getPeerConnectionIndex = (pc) => { var _a; return (_a = peerConnectionData.get(pc)) === null || _a === void 0 ? void 0 : _a.index; };
1457
1457
  const setPeerConnectionsForTests = (pcs) => (peerConnections = pcs);
1458
1458
 
@@ -1496,7 +1496,7 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1496
1496
  }
1497
1497
  });
1498
1498
  if (missingSsrcs) {
1499
- const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()];
1499
+ const sendersAndReceivers = [...pc.getSenders(), ...pc.getReceivers()].filter((o) => o.track);
1500
1500
  const reports = yield Promise.all(sendersAndReceivers.map((o) => o.getStats()));
1501
1501
  reports.forEach((tReport, index) => {
1502
1502
  tReport.forEach((stats) => {
@@ -1506,8 +1506,8 @@ const getPeerConnectionsWithStatsReports = (pcDataByPc = PC_DATA_BY_PC) => Promi
1506
1506
  });
1507
1507
  });
1508
1508
  missingSsrcs.forEach((ssrc) => {
1509
- numMissingTrackSsrcLookups++;
1510
1509
  if (!pcData.ssrcToTrackId[ssrc]) {
1510
+ numMissingTrackSsrcLookups++;
1511
1511
  pcData.ssrcToTrackId[ssrc] = "?" + ssrc;
1512
1512
  }
1513
1513
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@whereby.com/media",
3
3
  "description": "Media library for Whereby",
4
- "version": "8.2.8",
4
+ "version": "8.3.0",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {
@@ -63,9 +63,9 @@
63
63
  "typescript": "^5.8.3",
64
64
  "@whereby.com/eslint-config": "0.1.0",
65
65
  "@whereby.com/jest-config": "0.1.0",
66
+ "@whereby.com/prettier-config": "0.1.0",
66
67
  "@whereby.com/rollup-config": "0.1.1",
67
- "@whereby.com/tsconfig": "0.1.0",
68
- "@whereby.com/prettier-config": "0.1.0"
68
+ "@whereby.com/tsconfig": "0.1.0"
69
69
  },
70
70
  "engines": {
71
71
  "node": ">=16.0.0"