@cloudflare/realtimekit-react 1.2.0-staging.15 → 1.2.0-staging.17

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
@@ -19580,17 +19580,20 @@ const Tg = {
19580
19580
  }
19581
19581
  ]]
19582
19582
  ], eD = (s, t) => {
19583
- var c;
19584
- const e = "getSettings" in t && t.getSettings().width || "getConstraints" in t && t.getConstraints().width || "originalSettings" in t && ((c = t.originalSettings) == null ? void 0 : c.width);
19585
- let r = Z0;
19586
- s.getValue("flagsmith").hasFeature(Z.OVERRIDE_HIVE_SIMULCAST_DYNAMIC) && (r = JSON.parse(s.getValue("flagsmith").getValue(
19583
+ var d, l, p;
19584
+ const e = (d = s == null ? void 0 : s.getValue("overrides")) == null ? void 0 : d.simulcastConfig;
19585
+ if ((l = e == null ? void 0 : e.encodings) != null && l.length)
19586
+ return e.encodings;
19587
+ const r = "getSettings" in t && t.getSettings().width || "getConstraints" in t && t.getConstraints().width || "originalSettings" in t && ((p = t.originalSettings) == null ? void 0 : p.width);
19588
+ let i = Z0;
19589
+ s.getValue("flagsmith").hasFeature(Z.OVERRIDE_HIVE_SIMULCAST_DYNAMIC) && (i = JSON.parse(s.getValue("flagsmith").getValue(
19587
19590
  Z.OVERRIDE_HIVE_SIMULCAST_DYNAMIC
19588
19591
  )));
19589
- const i = r.map(([d]) => d).sort((d, l) => d - l);
19590
- let a = Number.MAX_VALUE, o = 0;
19591
- return i.forEach((d, l) => {
19592
- Math.abs(d - e) < a && (a = Math.abs(d - e), o = l);
19593
- }), r[o][1];
19592
+ const a = i.map(([g]) => g).sort((g, S) => g - S);
19593
+ let o = Number.MAX_VALUE, c = 0;
19594
+ return a.forEach((g, S) => {
19595
+ Math.abs(g - r) < o && (o = Math.abs(g - r), c = S);
19596
+ }), i[c][1];
19594
19597
  };
19595
19598
  var pe = /* @__PURE__ */ ((s) => (s.WEBCAM = "webcam", s.WEBCAM_BACKUP = "webcam_backup", s.MIC = "mic", s.SCREENSHARE_VIDEO = "screenshare_video", s.SCREENSHARE_AUDIO = "screenshare_audio", s))(pe || {});
19596
19599
  const tD = _P(), Tn = bs(
@@ -26335,7 +26338,9 @@ class aO {
26335
26338
  consumers: e
26336
26339
  }
26337
26340
  }, i = yield this.recvTransport.sendDataChannelMessage("events", r), { failedConsumers: a } = i;
26338
- return { failedConsumers: a };
26341
+ return t.forEach((o) => {
26342
+ a != null && a.includes(o.id) || o.close(void 0, false);
26343
+ }), { failedConsumers: a };
26339
26344
  });
26340
26345
  }
26341
26346
  switchConsumersToLayer(t, e) {
@@ -27212,28 +27217,29 @@ const MS = (Eu = class {
27212
27217
  }
27213
27218
  _shareWebcam(s, t) {
27214
27219
  return u(this, null, function* () {
27220
+ var S, v;
27215
27221
  const e = t === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, r = V(this, tt, gt).call(this, e);
27216
27222
  if (r) {
27217
- const p = yield r;
27218
- if (n(this, W).producers.has(p)) {
27219
- const g = n(this, W).producers.get(p);
27220
- if (!g.closed)
27221
- return yield g.replaceTrack({ track: s }), yield this.resumeWebcam(e), s;
27223
+ const _ = yield r;
27224
+ if (n(this, W).producers.has(_)) {
27225
+ const P = n(this, W).producers.get(_);
27226
+ if (!P.closed)
27227
+ return yield P.replaceTrack({ track: s }), yield this.resumeWebcam(e), s;
27222
27228
  yield this.disableWebcam(t);
27223
27229
  }
27224
27230
  return this._shareWebcam(s, t);
27225
27231
  }
27226
- const i = [t].concat(Nt.filter((p) => p !== t)), a = V(this, Dl, HS).call(this, s, i), o = Ha(this.context, "disableSimulcast"), c = n(this, Hs) === be.CF ? Z.ENABLE_CF_SIMULCAST : Z.ENABLE_HIVE_SIMULCAST;
27227
- !o && this.context.getValue("flagsmith").hasFeature(c) ? (this.logger.info(`Simulcast enabled for SFU: ${n(this, Hs)}`), a.encodings = eD(this.context, s)) : this.logger.info(`Simulcast disabled for webcam producer, SFU: ${n(this, Hs)}`), this.context.getValue("flagsmith").hasFeature(Z.TRACK_HINT) && (a.track.contentHint = this.context.getValue("flagsmith").getValue(
27232
+ const i = [t].concat(Nt.filter((_) => _ !== t)), a = V(this, Dl, HS).call(this, s, i), o = Ha(this.context, "disableSimulcast"), c = (v = (S = this.context) == null ? void 0 : S.getValue("overrides")) == null ? void 0 : v.simulcastConfig, d = o || c && c.disable, l = n(this, Hs) === be.CF ? Z.ENABLE_CF_SIMULCAST : Z.ENABLE_HIVE_SIMULCAST;
27233
+ !d && this.context.getValue("flagsmith").hasFeature(l) ? (this.logger.info(`Simulcast enabled for SFU: ${n(this, Hs)}`), a.encodings = eD(this.context, s)) : this.logger.info(`Simulcast disabled for webcam producer, SFU: ${n(this, Hs)}`), this.context.getValue("flagsmith").hasFeature(Z.TRACK_HINT) && (a.track.contentHint = this.context.getValue("flagsmith").getValue(
27228
27234
  Z.TRACK_HINT
27229
27235
  ));
27230
- const d = () => {
27236
+ const p = () => {
27231
27237
  this.logger.info("Disabling video due to the producer closure"), n(this, Tt).delete(e);
27232
- }, l = n(this, W).createProducer(
27238
+ }, g = n(this, W).createProducer(
27233
27239
  a,
27234
- d
27240
+ p
27235
27241
  );
27236
- return V(this, en, Eo).call(this, e, l.then((p) => p.id)), l.then((p) => p.track);
27242
+ return V(this, en, Eo).call(this, e, g.then((_) => _.id)), g.then((_) => _.track);
27237
27243
  });
27238
27244
  }
27239
27245
  shareWebcam(s) {
@@ -30689,7 +30695,7 @@ let ii = (em = class {
30689
30695
  video: true
30690
30696
  };
30691
30697
  return a.setValue("options", e), a.setValue("peerId", t), a.setValue("modules", o), a.setValue("sdkName", "web-core"), a.setValue("meetingId", r), a.setValue("apiBase", i.apiBase), a.setValue("baseURI", i.baseURI), a.setValue("userId", i.participantId), a.setValue("organizationId", i.orgId), a.setValue("authToken", e.authToken), a.setValue("overrides", (d = e.overrides) != null ? d : {}), a.setValue("env", TR({ baseURI: i.baseURI })), a.setValue("defaults", c), a.setValue("onError", e.onError || (() => {
30692
- })), a.setValue("cachedUserDetails", bs(e.cachedUserDetails)), a.setValue("sdkVersion", "3.2.0-staging.15"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new i1()), a;
30698
+ })), a.setValue("cachedUserDetails", bs(e.cachedUserDetails)), a.setValue("sdkVersion", "3.2.0-staging.17"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new i1()), a;
30693
30699
  }
30694
30700
  join() {
30695
30701
  return u(this, null, function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudflare/realtimekit-react",
3
- "version": "1.2.0-staging.15",
3
+ "version": "1.2.0-staging.17",
4
4
  "description": "A real-time video and audio SDK for building custom, collaborative communication experiences.",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "module": "./dist/index.es.js",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "private": false,
22
22
  "dependencies": {
23
- "@cloudflare/realtimekit": "1.2.0-staging.15"
23
+ "@cloudflare/realtimekit": "1.2.0-staging.17"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=16.8.6"