@cloudflare/realtimekit-react 1.2.0-staging.16 → 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(
@@ -27214,28 +27217,29 @@ const MS = (Eu = class {
27214
27217
  }
27215
27218
  _shareWebcam(s, t) {
27216
27219
  return u(this, null, function* () {
27220
+ var S, v;
27217
27221
  const e = t === "video/VP9" ? pe.WEBCAM : pe.WEBCAM_BACKUP, r = V(this, tt, gt).call(this, e);
27218
27222
  if (r) {
27219
- const p = yield r;
27220
- if (n(this, W).producers.has(p)) {
27221
- const g = n(this, W).producers.get(p);
27222
- if (!g.closed)
27223
- 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;
27224
27228
  yield this.disableWebcam(t);
27225
27229
  }
27226
27230
  return this._shareWebcam(s, t);
27227
27231
  }
27228
- 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;
27229
- !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(
27230
27234
  Z.TRACK_HINT
27231
27235
  ));
27232
- const d = () => {
27236
+ const p = () => {
27233
27237
  this.logger.info("Disabling video due to the producer closure"), n(this, Tt).delete(e);
27234
- }, l = n(this, W).createProducer(
27238
+ }, g = n(this, W).createProducer(
27235
27239
  a,
27236
- d
27240
+ p
27237
27241
  );
27238
- 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);
27239
27243
  });
27240
27244
  }
27241
27245
  shareWebcam(s) {
@@ -30691,7 +30695,7 @@ let ii = (em = class {
30691
30695
  video: true
30692
30696
  };
30693
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 || (() => {
30694
- })), a.setValue("cachedUserDetails", bs(e.cachedUserDetails)), a.setValue("sdkVersion", "3.2.0-staging.16"), (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;
30695
30699
  }
30696
30700
  join() {
30697
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.16",
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.16"
23
+ "@cloudflare/realtimekit": "1.2.0-staging.17"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "react": ">=16.8.6"