@whereby.com/media 8.2.0 → 8.2.2

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
@@ -2543,6 +2543,7 @@ class P2pRtcManager {
2543
2543
  P2PMicNotWorking: 0,
2544
2544
  P2PLocalNetworkFailed: 0,
2545
2545
  P2PRelayedIceCandidate: 0,
2546
+ P2PAddStoppedVideoTrack: 0,
2546
2547
  };
2547
2548
  }
2548
2549
  numberOfPeerconnections() {
@@ -2836,7 +2837,6 @@ class P2pRtcManager {
2836
2837
  return this.peerConnections[clientId];
2837
2838
  }
2838
2839
  _createSession({ clientId, initialBandwidth, isOfferer }) {
2839
- var _a, _b;
2840
2840
  if (!clientId) {
2841
2841
  throw new Error("clientId is missing");
2842
2842
  }
@@ -3099,8 +3099,10 @@ class P2pRtcManager {
3099
3099
  if (this._features.increaseIncomingMediaBufferOn) {
3100
3100
  this._setJitterBufferTarget(pc);
3101
3101
  }
3102
- if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
3103
- session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3102
+ if (this._localCameraStream && !this._localCameraStream.getVideoTracks().length && this._stoppedVideoTrack) {
3103
+ pc.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3104
+ this.analytics.P2PAddStoppedVideoTrack++;
3105
+ rtcStats.sendEvent("P2PAddStoppedVideoTrack", { trackId: this._stoppedVideoTrack.id });
3104
3106
  }
3105
3107
  return session;
3106
3108
  }
package/dist/index.d.cts CHANGED
@@ -1345,6 +1345,7 @@ type P2PAnalytics = {
1345
1345
  P2PMicNotWorking: number;
1346
1346
  P2PLocalNetworkFailed: number;
1347
1347
  P2PRelayedIceCandidate: number;
1348
+ P2PAddStoppedVideoTrack: number;
1348
1349
  };
1349
1350
  type P2PAnalyticMetric = keyof P2PAnalytics;
1350
1351
  type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
package/dist/index.d.mts CHANGED
@@ -1345,6 +1345,7 @@ type P2PAnalytics = {
1345
1345
  P2PMicNotWorking: number;
1346
1346
  P2PLocalNetworkFailed: number;
1347
1347
  P2PRelayedIceCandidate: number;
1348
+ P2PAddStoppedVideoTrack: number;
1348
1349
  };
1349
1350
  type P2PAnalyticMetric = keyof P2PAnalytics;
1350
1351
  type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
package/dist/index.d.ts CHANGED
@@ -1345,6 +1345,7 @@ type P2PAnalytics = {
1345
1345
  P2PMicNotWorking: number;
1346
1346
  P2PLocalNetworkFailed: number;
1347
1347
  P2PRelayedIceCandidate: number;
1348
+ P2PAddStoppedVideoTrack: number;
1348
1349
  };
1349
1350
  type P2PAnalyticMetric = keyof P2PAnalytics;
1350
1351
  type P2PIncrementAnalyticMetric = (metric: P2PAnalyticMetric) => void;
package/dist/index.mjs CHANGED
@@ -2522,6 +2522,7 @@ class P2pRtcManager {
2522
2522
  P2PMicNotWorking: 0,
2523
2523
  P2PLocalNetworkFailed: 0,
2524
2524
  P2PRelayedIceCandidate: 0,
2525
+ P2PAddStoppedVideoTrack: 0,
2525
2526
  };
2526
2527
  }
2527
2528
  numberOfPeerconnections() {
@@ -2815,7 +2816,6 @@ class P2pRtcManager {
2815
2816
  return this.peerConnections[clientId];
2816
2817
  }
2817
2818
  _createSession({ clientId, initialBandwidth, isOfferer }) {
2818
- var _a, _b;
2819
2819
  if (!clientId) {
2820
2820
  throw new Error("clientId is missing");
2821
2821
  }
@@ -3078,8 +3078,10 @@ class P2pRtcManager {
3078
3078
  if (this._features.increaseIncomingMediaBufferOn) {
3079
3079
  this._setJitterBufferTarget(pc);
3080
3080
  }
3081
- if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
3082
- session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3081
+ if (this._localCameraStream && !this._localCameraStream.getVideoTracks().length && this._stoppedVideoTrack) {
3082
+ pc.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3083
+ this.analytics.P2PAddStoppedVideoTrack++;
3084
+ rtcStats.sendEvent("P2PAddStoppedVideoTrack", { trackId: this._stoppedVideoTrack.id });
3083
3085
  }
3084
3086
  return session;
3085
3087
  }
@@ -2522,6 +2522,7 @@ class P2pRtcManager {
2522
2522
  P2PMicNotWorking: 0,
2523
2523
  P2PLocalNetworkFailed: 0,
2524
2524
  P2PRelayedIceCandidate: 0,
2525
+ P2PAddStoppedVideoTrack: 0,
2525
2526
  };
2526
2527
  }
2527
2528
  numberOfPeerconnections() {
@@ -2815,7 +2816,6 @@ class P2pRtcManager {
2815
2816
  return this.peerConnections[clientId];
2816
2817
  }
2817
2818
  _createSession({ clientId, initialBandwidth, isOfferer }) {
2818
- var _a, _b;
2819
2819
  if (!clientId) {
2820
2820
  throw new Error("clientId is missing");
2821
2821
  }
@@ -3078,8 +3078,10 @@ class P2pRtcManager {
3078
3078
  if (this._features.increaseIncomingMediaBufferOn) {
3079
3079
  this._setJitterBufferTarget(pc);
3080
3080
  }
3081
- if (((_b = (_a = this._localCameraStream) === null || _a === void 0 ? void 0 : _a.getVideoTracks()) === null || _b === void 0 ? void 0 : _b.length) && this._stoppedVideoTrack) {
3082
- session.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3081
+ if (this._localCameraStream && !this._localCameraStream.getVideoTracks().length && this._stoppedVideoTrack) {
3082
+ pc.addTrack(this._stoppedVideoTrack, this._localCameraStream);
3083
+ this.analytics.P2PAddStoppedVideoTrack++;
3084
+ rtcStats.sendEvent("P2PAddStoppedVideoTrack", { trackId: this._stoppedVideoTrack.id });
3083
3085
  }
3084
3086
  return session;
3085
3087
  }
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.0",
4
+ "version": "8.2.2",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "check-ip": "^1.1.1",
42
42
  "events": "^3.3.0",
43
43
  "ip-address": "^9.0.5",
44
- "@whereby.com/mediasoup-client": "3.15.8",
44
+ "@whereby.com/mediasoup-client": "3.18.7",
45
45
  "rtcstats": "github:whereby/rtcstats#5.4.1",
46
46
  "sdp": "^3.2.0",
47
47
  "sdp-transform": "^2.14.2",