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