@stream-io/video-client 0.0.3 → 0.0.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.js CHANGED
@@ -5243,8 +5243,8 @@ const removeCodec = (sdp, mediaType, codecToRemove) => {
5243
5243
  const fmtp = section === null || section === void 0 ? void 0 : section.fmtp.find((f) => f.payload === codecId);
5244
5244
  return sdp
5245
5245
  .replace(mediaSection.original, `${mediaSection.mediaWithPorts} ${newCodecOrder}`)
5246
- .replace(new RegExp(`${rtpMap.original}[\r\n|\r|\n]`), '') // remove the corresponding rtpmap line
5247
- .replace((fmtp === null || fmtp === void 0 ? void 0 : fmtp.original) ? new RegExp(`${fmtp === null || fmtp === void 0 ? void 0 : fmtp.original}[\r\n|\r|\n]`) : '', ''); // remove the corresponding fmtp line
5246
+ .replace(new RegExp(`${rtpMap.original}[\r\n]+`), '') // remove the corresponding rtpmap line
5247
+ .replace((fmtp === null || fmtp === void 0 ? void 0 : fmtp.original) ? new RegExp(`${fmtp === null || fmtp === void 0 ? void 0 : fmtp.original}[\r\n]+`) : '', ''); // remove the corresponding fmtp line
5248
5248
  };
5249
5249
  /**
5250
5250
  * Gets the fmtp line corresponding to opus
@@ -5254,8 +5254,7 @@ const getOpusFmtp = (sdp) => {
5254
5254
  const rtpMap = section === null || section === void 0 ? void 0 : section.rtpMap.find((r) => r.codec.toLowerCase() === 'opus');
5255
5255
  const codecId = rtpMap === null || rtpMap === void 0 ? void 0 : rtpMap.payload;
5256
5256
  if (codecId) {
5257
- const fmtp = section === null || section === void 0 ? void 0 : section.fmtp.find((f) => f.payload === codecId);
5258
- return fmtp;
5257
+ return section === null || section === void 0 ? void 0 : section.fmtp.find((f) => f.payload === codecId);
5259
5258
  }
5260
5259
  };
5261
5260
  /**
@@ -5788,7 +5787,7 @@ class Publisher {
5788
5787
  const offer = yield this.publisher.createOffer();
5789
5788
  let sdp = offer.sdp;
5790
5789
  if (sdp) {
5791
- toggleDtx(sdp, this.isDtxEnabled);
5790
+ sdp = toggleDtx(sdp, this.isDtxEnabled);
5792
5791
  if (isReactNative()) {
5793
5792
  if (this.preferredVideoCodec) {
5794
5793
  sdp = setPreferredCodec(sdp, 'video', this.preferredVideoCodec);
@@ -10996,7 +10995,7 @@ class StreamClient {
10996
10995
  }
10997
10996
  getUserAgent() {
10998
10997
  return (this.userAgent ||
10999
- `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.2"}`);
10998
+ `stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${"0.0.3"}`);
11000
10999
  }
11001
11000
  setUserAgent(userAgent) {
11002
11001
  this.userAgent = userAgent;