@whereby.com/media 11.2.2 → 11.2.4

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
@@ -2803,12 +2803,9 @@ class P2pRtcManager {
2803
2803
  logger$7.warn("RtcManager closed. Will not send event", eventName, data);
2804
2804
  return;
2805
2805
  }
2806
- if (this._features.awaitJoinRoomFinished && !this._serverSocket.joinRoomFinished) {
2807
- rtcStats.sendEvent("skip_emitting_server_message", { eventName });
2808
- }
2809
- else {
2810
- this._serverSocket.emit(eventName, data);
2811
- }
2806
+ if (!this._serverSocket.joinRoomFinished)
2807
+ return;
2808
+ this._serverSocket.emit(eventName, data);
2812
2809
  }
2813
2810
  _emit(eventName, data) {
2814
2811
  this._emitter.emit(eventName, data);
@@ -7157,9 +7154,12 @@ class BandwidthTester extends EventEmitter {
7157
7154
  this.emit("result", {
7158
7155
  error: true,
7159
7156
  });
7160
- clearTimeout(this._resultTimeout);
7161
7157
  }
7162
7158
  this._clearTimeouts();
7159
+ if (this._resultTimeout) {
7160
+ clearTimeout(this._resultTimeout);
7161
+ this._resultTimeout = null;
7162
+ }
7163
7163
  clearInterval(this._drawInterval);
7164
7164
  this._drawInterval = null;
7165
7165
  if (this._sendTransport) {
@@ -7396,6 +7396,9 @@ class BandwidthTester extends EventEmitter {
7396
7396
  }
7397
7397
  _reportResults() {
7398
7398
  return __awaiter(this, void 0, void 0, function* () {
7399
+ if (this.closed) {
7400
+ return;
7401
+ }
7399
7402
  const [localSendStats, localRecvStats] = yield Promise.all([
7400
7403
  this._sendTransport.getStats(),
7401
7404
  this._receiveTransport.getStats(),
package/dist/index.mjs CHANGED
@@ -2783,12 +2783,9 @@ class P2pRtcManager {
2783
2783
  logger$7.warn("RtcManager closed. Will not send event", eventName, data);
2784
2784
  return;
2785
2785
  }
2786
- if (this._features.awaitJoinRoomFinished && !this._serverSocket.joinRoomFinished) {
2787
- rtcStats.sendEvent("skip_emitting_server_message", { eventName });
2788
- }
2789
- else {
2790
- this._serverSocket.emit(eventName, data);
2791
- }
2786
+ if (!this._serverSocket.joinRoomFinished)
2787
+ return;
2788
+ this._serverSocket.emit(eventName, data);
2792
2789
  }
2793
2790
  _emit(eventName, data) {
2794
2791
  this._emitter.emit(eventName, data);
@@ -7137,9 +7134,12 @@ class BandwidthTester extends EventEmitter {
7137
7134
  this.emit("result", {
7138
7135
  error: true,
7139
7136
  });
7140
- clearTimeout(this._resultTimeout);
7141
7137
  }
7142
7138
  this._clearTimeouts();
7139
+ if (this._resultTimeout) {
7140
+ clearTimeout(this._resultTimeout);
7141
+ this._resultTimeout = null;
7142
+ }
7143
7143
  clearInterval(this._drawInterval);
7144
7144
  this._drawInterval = null;
7145
7145
  if (this._sendTransport) {
@@ -7376,6 +7376,9 @@ class BandwidthTester extends EventEmitter {
7376
7376
  }
7377
7377
  _reportResults() {
7378
7378
  return __awaiter(this, void 0, void 0, function* () {
7379
+ if (this.closed) {
7380
+ return;
7381
+ }
7379
7382
  const [localSendStats, localRecvStats] = yield Promise.all([
7380
7383
  this._sendTransport.getStats(),
7381
7384
  this._receiveTransport.getStats(),
@@ -2783,12 +2783,9 @@ class P2pRtcManager {
2783
2783
  logger$7.warn("RtcManager closed. Will not send event", eventName, data);
2784
2784
  return;
2785
2785
  }
2786
- if (this._features.awaitJoinRoomFinished && !this._serverSocket.joinRoomFinished) {
2787
- rtcStats.sendEvent("skip_emitting_server_message", { eventName });
2788
- }
2789
- else {
2790
- this._serverSocket.emit(eventName, data);
2791
- }
2786
+ if (!this._serverSocket.joinRoomFinished)
2787
+ return;
2788
+ this._serverSocket.emit(eventName, data);
2792
2789
  }
2793
2790
  _emit(eventName, data) {
2794
2791
  this._emitter.emit(eventName, data);
@@ -7137,9 +7134,12 @@ class BandwidthTester extends EventEmitter {
7137
7134
  this.emit("result", {
7138
7135
  error: true,
7139
7136
  });
7140
- clearTimeout(this._resultTimeout);
7141
7137
  }
7142
7138
  this._clearTimeouts();
7139
+ if (this._resultTimeout) {
7140
+ clearTimeout(this._resultTimeout);
7141
+ this._resultTimeout = null;
7142
+ }
7143
7143
  clearInterval(this._drawInterval);
7144
7144
  this._drawInterval = null;
7145
7145
  if (this._sendTransport) {
@@ -7376,6 +7376,9 @@ class BandwidthTester extends EventEmitter {
7376
7376
  }
7377
7377
  _reportResults() {
7378
7378
  return __awaiter(this, void 0, void 0, function* () {
7379
+ if (this.closed) {
7380
+ return;
7381
+ }
7379
7382
  const [localSendStats, localRecvStats] = yield Promise.all([
7380
7383
  this._sendTransport.getStats(),
7381
7384
  this._receiveTransport.getStats(),
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": "11.2.2",
4
+ "version": "11.2.4",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {