@whereby.com/media 2.8.5 → 2.8.7

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
@@ -2373,6 +2373,7 @@ class Session {
2373
2373
  else {
2374
2374
  answerToSignal = {
2375
2375
  sdp: answer.sdp,
2376
+ sdpU: answer.sdp,
2376
2377
  type: answer.type,
2377
2378
  };
2378
2379
  return this.pc.setLocalDescription(answer);
@@ -2819,8 +2820,12 @@ class P2pRtcManager {
2819
2820
  logger$6.warn("No RTCPeerConnection on SDP_OFFER", data);
2820
2821
  return;
2821
2822
  }
2823
+ const sdp = {
2824
+ sdp: data.message.sdp || data.message.sdpU,
2825
+ type: data.message.type,
2826
+ };
2822
2827
  (_b = (_a = session
2823
- .handleOffer(data.message)
2828
+ .handleOffer(sdp)
2824
2829
  .then((answer) => {
2825
2830
  this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
2826
2831
  receiverId: data.clientId,
@@ -2837,7 +2842,11 @@ class P2pRtcManager {
2837
2842
  logger$6.warn("No RTCPeerConnection on SDP_ANSWER", data);
2838
2843
  return;
2839
2844
  }
2840
- (_b = (_a = session.handleAnswer(data.message)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2845
+ const sdp = {
2846
+ sdp: data.message.sdp || data.message.sdpU,
2847
+ type: data.message.type,
2848
+ };
2849
+ (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2841
2850
  logger$6.warn("Could not set remote description from remote answer: ", e);
2842
2851
  this.analytics.numPcOnAnswerFailure++;
2843
2852
  });
@@ -3026,17 +3035,6 @@ class P2pRtcManager {
3026
3035
  const peerConnectionConfig = {
3027
3036
  iceServers: this._features.turnServersOn ? this._turnServers : this._iceServers,
3028
3037
  };
3029
- const constraints = { optional: [] };
3030
- constraints.optional.push({ rtcStatsRoomSessionId: this._roomSessionId });
3031
- constraints.optional.push({ rtcStatsClientId: this._selfId });
3032
- constraints.optional.push({ rtcStatsPeerId: peerConnectionId });
3033
- constraints.optional.push({ rtcStatsConferenceId: this._roomName });
3034
- if (browserName$1 === "chrome") {
3035
- constraints.optional.push({
3036
- googCpuOveruseDetection: true,
3037
- });
3038
- peerConnectionConfig.sdpSemantics = "unified-plan";
3039
- }
3040
3038
  peerConnectionConfig.iceServers = turnServerOverride(peerConnectionConfig.iceServers, this._features.turnServerOverrideHost);
3041
3039
  external_stun_servers(peerConnectionConfig, this._features);
3042
3040
  maybeTurnOnly(peerConnectionConfig, this._features);
@@ -3403,9 +3401,14 @@ class P2pRtcManager {
3403
3401
  throw e;
3404
3402
  })
3405
3403
  .then(() => {
3404
+ const message = {
3405
+ sdp: offer.sdp,
3406
+ sdpU: offer.sdp,
3407
+ type: offer.type,
3408
+ };
3406
3409
  this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
3407
3410
  receiverId: clientId,
3408
- message: offer,
3411
+ message,
3409
3412
  });
3410
3413
  });
3411
3414
  })
package/dist/index.d.cts CHANGED
@@ -1016,7 +1016,8 @@ type RtcEvents = {
1016
1016
  remote_stream_track_removed: void;
1017
1017
  };
1018
1018
  type RTCSessionDescription = {
1019
- sdp: string;
1019
+ sdp?: string;
1020
+ sdpU?: string;
1020
1021
  type: RTCSdpType;
1021
1022
  };
1022
1023
  type SDPRelayMessage = {
package/dist/index.d.mts CHANGED
@@ -1016,7 +1016,8 @@ type RtcEvents = {
1016
1016
  remote_stream_track_removed: void;
1017
1017
  };
1018
1018
  type RTCSessionDescription = {
1019
- sdp: string;
1019
+ sdp?: string;
1020
+ sdpU?: string;
1020
1021
  type: RTCSdpType;
1021
1022
  };
1022
1023
  type SDPRelayMessage = {
package/dist/index.d.ts CHANGED
@@ -1016,7 +1016,8 @@ type RtcEvents = {
1016
1016
  remote_stream_track_removed: void;
1017
1017
  };
1018
1018
  type RTCSessionDescription = {
1019
- sdp: string;
1019
+ sdp?: string;
1020
+ sdpU?: string;
1020
1021
  type: RTCSdpType;
1021
1022
  };
1022
1023
  type SDPRelayMessage = {
package/dist/index.mjs CHANGED
@@ -2352,6 +2352,7 @@ class Session {
2352
2352
  else {
2353
2353
  answerToSignal = {
2354
2354
  sdp: answer.sdp,
2355
+ sdpU: answer.sdp,
2355
2356
  type: answer.type,
2356
2357
  };
2357
2358
  return this.pc.setLocalDescription(answer);
@@ -2798,8 +2799,12 @@ class P2pRtcManager {
2798
2799
  logger$6.warn("No RTCPeerConnection on SDP_OFFER", data);
2799
2800
  return;
2800
2801
  }
2802
+ const sdp = {
2803
+ sdp: data.message.sdp || data.message.sdpU,
2804
+ type: data.message.type,
2805
+ };
2801
2806
  (_b = (_a = session
2802
- .handleOffer(data.message)
2807
+ .handleOffer(sdp)
2803
2808
  .then((answer) => {
2804
2809
  this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
2805
2810
  receiverId: data.clientId,
@@ -2816,7 +2821,11 @@ class P2pRtcManager {
2816
2821
  logger$6.warn("No RTCPeerConnection on SDP_ANSWER", data);
2817
2822
  return;
2818
2823
  }
2819
- (_b = (_a = session.handleAnswer(data.message)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2824
+ const sdp = {
2825
+ sdp: data.message.sdp || data.message.sdpU,
2826
+ type: data.message.type,
2827
+ };
2828
+ (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2820
2829
  logger$6.warn("Could not set remote description from remote answer: ", e);
2821
2830
  this.analytics.numPcOnAnswerFailure++;
2822
2831
  });
@@ -3005,17 +3014,6 @@ class P2pRtcManager {
3005
3014
  const peerConnectionConfig = {
3006
3015
  iceServers: this._features.turnServersOn ? this._turnServers : this._iceServers,
3007
3016
  };
3008
- const constraints = { optional: [] };
3009
- constraints.optional.push({ rtcStatsRoomSessionId: this._roomSessionId });
3010
- constraints.optional.push({ rtcStatsClientId: this._selfId });
3011
- constraints.optional.push({ rtcStatsPeerId: peerConnectionId });
3012
- constraints.optional.push({ rtcStatsConferenceId: this._roomName });
3013
- if (browserName$1 === "chrome") {
3014
- constraints.optional.push({
3015
- googCpuOveruseDetection: true,
3016
- });
3017
- peerConnectionConfig.sdpSemantics = "unified-plan";
3018
- }
3019
3017
  peerConnectionConfig.iceServers = turnServerOverride(peerConnectionConfig.iceServers, this._features.turnServerOverrideHost);
3020
3018
  external_stun_servers(peerConnectionConfig, this._features);
3021
3019
  maybeTurnOnly(peerConnectionConfig, this._features);
@@ -3382,9 +3380,14 @@ class P2pRtcManager {
3382
3380
  throw e;
3383
3381
  })
3384
3382
  .then(() => {
3383
+ const message = {
3384
+ sdp: offer.sdp,
3385
+ sdpU: offer.sdp,
3386
+ type: offer.type,
3387
+ };
3385
3388
  this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
3386
3389
  receiverId: clientId,
3387
- message: offer,
3390
+ message,
3388
3391
  });
3389
3392
  });
3390
3393
  })
@@ -2352,6 +2352,7 @@ class Session {
2352
2352
  else {
2353
2353
  answerToSignal = {
2354
2354
  sdp: answer.sdp,
2355
+ sdpU: answer.sdp,
2355
2356
  type: answer.type,
2356
2357
  };
2357
2358
  return this.pc.setLocalDescription(answer);
@@ -2798,8 +2799,12 @@ class P2pRtcManager {
2798
2799
  logger$6.warn("No RTCPeerConnection on SDP_OFFER", data);
2799
2800
  return;
2800
2801
  }
2802
+ const sdp = {
2803
+ sdp: data.message.sdp || data.message.sdpU,
2804
+ type: data.message.type,
2805
+ };
2801
2806
  (_b = (_a = session
2802
- .handleOffer(data.message)
2807
+ .handleOffer(sdp)
2803
2808
  .then((answer) => {
2804
2809
  this._emitServerEvent(RELAY_MESSAGES.SDP_ANSWER, {
2805
2810
  receiverId: data.clientId,
@@ -2816,7 +2821,11 @@ class P2pRtcManager {
2816
2821
  logger$6.warn("No RTCPeerConnection on SDP_ANSWER", data);
2817
2822
  return;
2818
2823
  }
2819
- (_b = (_a = session.handleAnswer(data.message)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2824
+ const sdp = {
2825
+ sdp: data.message.sdp || data.message.sdpU,
2826
+ type: data.message.type,
2827
+ };
2828
+ (_b = (_a = session.handleAnswer(sdp)) === null || _a === void 0 ? void 0 : _a.catch) === null || _b === void 0 ? void 0 : _b.call(_a, (e) => {
2820
2829
  logger$6.warn("Could not set remote description from remote answer: ", e);
2821
2830
  this.analytics.numPcOnAnswerFailure++;
2822
2831
  });
@@ -3005,17 +3014,6 @@ class P2pRtcManager {
3005
3014
  const peerConnectionConfig = {
3006
3015
  iceServers: this._features.turnServersOn ? this._turnServers : this._iceServers,
3007
3016
  };
3008
- const constraints = { optional: [] };
3009
- constraints.optional.push({ rtcStatsRoomSessionId: this._roomSessionId });
3010
- constraints.optional.push({ rtcStatsClientId: this._selfId });
3011
- constraints.optional.push({ rtcStatsPeerId: peerConnectionId });
3012
- constraints.optional.push({ rtcStatsConferenceId: this._roomName });
3013
- if (browserName$1 === "chrome") {
3014
- constraints.optional.push({
3015
- googCpuOveruseDetection: true,
3016
- });
3017
- peerConnectionConfig.sdpSemantics = "unified-plan";
3018
- }
3019
3017
  peerConnectionConfig.iceServers = turnServerOverride(peerConnectionConfig.iceServers, this._features.turnServerOverrideHost);
3020
3018
  external_stun_servers(peerConnectionConfig, this._features);
3021
3019
  maybeTurnOnly(peerConnectionConfig, this._features);
@@ -3382,9 +3380,14 @@ class P2pRtcManager {
3382
3380
  throw e;
3383
3381
  })
3384
3382
  .then(() => {
3383
+ const message = {
3384
+ sdp: offer.sdp,
3385
+ sdpU: offer.sdp,
3386
+ type: offer.type,
3387
+ };
3385
3388
  this._emitServerEvent(RELAY_MESSAGES.SDP_OFFER, {
3386
3389
  receiverId: clientId,
3387
- message: offer,
3390
+ message,
3388
3391
  });
3389
3392
  });
3390
3393
  })
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": "2.8.5",
4
+ "version": "2.8.7",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/whereby/sdk",
7
7
  "repository": {
@@ -62,8 +62,8 @@
62
62
  "process": "^0.11.10",
63
63
  "typescript": "^5.8.3",
64
64
  "@whereby.com/eslint-config": "0.1.0",
65
- "@whereby.com/jest-config": "0.1.0",
66
65
  "@whereby.com/prettier-config": "0.1.0",
66
+ "@whereby.com/jest-config": "0.1.0",
67
67
  "@whereby.com/rollup-config": "0.1.1",
68
68
  "@whereby.com/tsconfig": "0.1.0"
69
69
  },