@cloudflare/realtimekit 2.0.4-staging.1 → 2.0.4-staging.2

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
@@ -18544,7 +18544,7 @@ const co = (Pm = class {
18544
18544
  this.logger.debug(`Processing socket join for ${this.self.id === h.id ? "local peer" : "remote peer"} ${h.id} listed in socket peers.`), this.onParticipantSocketJoined(h), this.logger.debug(`Processed socket join for ${this.self.id === h.id ? "local peer" : "remote peer"} ${h.id} listed in socket peers.`);
18545
18545
  });
18546
18546
  }
18547
- handlePeerJoinedBroadcast({
18547
+ handlePeerMediaJoinedBroadcast({
18548
18548
  participant: s,
18549
18549
  producerHandoverFromPeerId: t
18550
18550
  }) {
@@ -18573,7 +18573,7 @@ const co = (Pm = class {
18573
18573
  this.handleSocketPeers.bind(this)
18574
18574
  ), this.roomSocketHandler.on(
18575
18575
  this.events.peerJoinedBroadcast,
18576
- this.handlePeerJoinedBroadcast.bind(this)
18576
+ this.handlePeerMediaJoinedBroadcast.bind(this)
18577
18577
  ), this.roomSocketHandler.on(
18578
18578
  this.events.selfJoinComplete,
18579
18579
  (r) => u(this, [r], function* ({
@@ -18705,35 +18705,37 @@ const co = (Pm = class {
18705
18705
  * Socket Service only
18706
18706
  */
18707
18707
  waitingRoomRequestHandler(s) {
18708
+ var r, i;
18709
+ this.logger.info(`Received waitlisted peers: ${((i = (r = s == null ? void 0 : s.requests) == null ? void 0 : r.map((a) => a.peerId)) == null ? void 0 : i.join(", ")) || "none"}`);
18708
18710
  const t = s.requests.filter(
18709
- (r) => !this.participants.waitlisted.toArray().find((i) => i.userId === r.userId)
18711
+ (a) => !this.participants.waitlisted.get(a.peerId)
18710
18712
  ), e = this.participants.waitlisted.toArray().filter(
18711
- (r) => !s.requests.find((i) => i.userId === r.userId)
18713
+ (a) => !s.requests.find((o) => o.peerId === a.id)
18712
18714
  );
18713
- t.forEach((r) => this.participants.waitlisted.add(
18715
+ t.forEach((a) => this.participants.waitlisted.add(
18714
18716
  new Sr(
18715
18717
  this.context,
18716
18718
  {
18717
- id: r.peerId,
18718
- displayName: r.displayName,
18719
+ id: a.peerId,
18720
+ displayName: a.displayName,
18719
18721
  audioMuted: !0,
18720
18722
  videoEnabled: !1,
18721
18723
  audioTrack: void 0,
18722
18724
  videoTrack: void 0,
18723
18725
  stageStatus: "OFF_STAGE",
18724
- userId: r.userId,
18726
+ userId: a.userId,
18725
18727
  flags: {},
18726
18728
  isHost: !1,
18727
- customParticipantId: r.customParticipantId,
18728
- picture: r.picture,
18729
+ customParticipantId: a.customParticipantId,
18730
+ picture: a.picture,
18729
18731
  metadata: {
18730
- preset_name: r.presetName
18732
+ preset_name: a.presetName
18731
18733
  }
18732
18734
  },
18733
18735
  this.self,
18734
18736
  this.roomSocketHandler
18735
18737
  )
18736
- )), e.forEach((r) => this.participants.waitlisted.delete(r.id));
18738
+ )), e.forEach((a) => this.participants.waitlisted.delete(a.id));
18737
18739
  }
18738
18740
  get maxPreferredStreams() {
18739
18741
  return this.participants.maxActiveParticipantsCount;
@@ -27569,7 +27571,7 @@ let oi = (Rm = class {
27569
27571
  video: !0
27570
27572
  };
27571
27573
  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", AC({ baseURI: i.baseURI })), a.setValue("defaults", c), a.setValue("onError", e.onError || (() => {
27572
- })), a.setValue("cachedUserDetails", Vs(e.cachedUserDetails)), a.setValue("sdkVersion", "2.0.4-staging.1"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new m1()), a;
27574
+ })), a.setValue("cachedUserDetails", Vs(e.cachedUserDetails)), a.setValue("sdkVersion", "2.0.4-staging.2"), (l = e.modules) != null && l.experimentalAudioPlayback && a.setValue("audioPlayback", new m1()), a;
27573
27575
  }
27574
27576
  join() {
27575
27577
  return u(this, null, function* () {
package/dist/index.es5.js CHANGED
@@ -18294,7 +18294,7 @@ var RM = Object.defineProperty, _M = Object.getOwnPropertyDescriptor, eo = funct
18294
18294
  }
18295
18295
  n.logger.debug("Processing socket join for ".concat(n.self.id === f.id ? "local peer" : "remote peer", " ").concat(f.id, " listed in socket peers.")), n.onParticipantSocketJoined(f), n.logger.debug("Processed socket join for ".concat(n.self.id === f.id ? "local peer" : "remote peer", " ").concat(f.id, " listed in socket peers."));
18296
18296
  });
18297
- } }, { key: "handlePeerJoinedBroadcast", value: function(e) {
18297
+ } }, { key: "handlePeerMediaJoinedBroadcast", value: function(e) {
18298
18298
  var t, n = e.participant, i = e.producerHandoverFromPeerId;
18299
18299
  if (n) {
18300
18300
  var a = n.peerId === this.self.id, o = (t = n.producerStates) !== null && t !== void 0 ? t : [];
@@ -18313,7 +18313,7 @@ var RM = Object.defineProperty, _M = Object.getOwnPropertyDescriptor, eo = funct
18313
18313
  key: "setupEvents",
18314
18314
  value: function() {
18315
18315
  var e = this;
18316
- this.roomSocketHandler.on(z.getWaitingRoomRequests, this.waitingRoomRequestHandler.bind(this)), this.context.getValue("peerSessionStore").on($.SOCKET_PEERS, this.handleSocketPeers.bind(this)), this.roomSocketHandler.on(this.events.peerJoinedBroadcast, this.handlePeerJoinedBroadcast.bind(this)), this.roomSocketHandler.on(this.events.selfJoinComplete, /* @__PURE__ */ function() {
18316
+ this.roomSocketHandler.on(z.getWaitingRoomRequests, this.waitingRoomRequestHandler.bind(this)), this.context.getValue("peerSessionStore").on($.SOCKET_PEERS, this.handleSocketPeers.bind(this)), this.roomSocketHandler.on(this.events.peerJoinedBroadcast, this.handlePeerMediaJoinedBroadcast.bind(this)), this.roomSocketHandler.on(this.events.selfJoinComplete, /* @__PURE__ */ function() {
18317
18317
  var t = m(/* @__PURE__ */ h().m(function n(i) {
18318
18318
  var a, o, c, l, d, p;
18319
18319
  return h().w(function(v) {
@@ -18414,19 +18414,21 @@ var RM = Object.defineProperty, _M = Object.getOwnPropertyDescriptor, eo = funct
18414
18414
  * Socket Service only
18415
18415
  */
18416
18416
  }, { key: "waitingRoomRequestHandler", value: function(e) {
18417
- var t = this, n = e.requests.filter(function(a) {
18418
- return !t.participants.waitlisted.toArray().find(function(o) {
18419
- return o.userId === a.userId;
18420
- });
18421
- }), i = this.participants.waitlisted.toArray().filter(function(a) {
18422
- return !e.requests.find(function(o) {
18423
- return o.userId === a.userId;
18417
+ var t, n = this;
18418
+ this.logger.info("Received waitlisted peers: ".concat((e == null || (t = e.requests) === null || t === void 0 || (t = t.map(function(o) {
18419
+ return o.peerId;
18420
+ })) === null || t === void 0 ? void 0 : t.join(", ")) || "none"));
18421
+ var i = e.requests.filter(function(o) {
18422
+ return !n.participants.waitlisted.get(o.peerId);
18423
+ }), a = this.participants.waitlisted.toArray().filter(function(o) {
18424
+ return !e.requests.find(function(c) {
18425
+ return c.peerId === o.id;
18424
18426
  });
18425
18427
  });
18426
- n.forEach(function(a) {
18427
- return t.participants.waitlisted.add(new Ji(t.context, { id: a.peerId, displayName: a.displayName, audioMuted: !0, videoEnabled: !1, audioTrack: void 0, videoTrack: void 0, stageStatus: "OFF_STAGE", userId: a.userId, flags: {}, isHost: !1, customParticipantId: a.customParticipantId, picture: a.picture, metadata: { preset_name: a.presetName } }, t.self, t.roomSocketHandler));
18428
- }), i.forEach(function(a) {
18429
- return t.participants.waitlisted.delete(a.id);
18428
+ i.forEach(function(o) {
18429
+ return n.participants.waitlisted.add(new Ji(n.context, { id: o.peerId, displayName: o.displayName, audioMuted: !0, videoEnabled: !1, audioTrack: void 0, videoTrack: void 0, stageStatus: "OFF_STAGE", userId: o.userId, flags: {}, isHost: !1, customParticipantId: o.customParticipantId, picture: o.picture, metadata: { preset_name: o.presetName } }, n.self, n.roomSocketHandler));
18430
+ }), a.forEach(function(o) {
18431
+ return n.participants.waitlisted.delete(o.id);
18430
18432
  });
18431
18433
  } }, { key: "maxPreferredStreams", get: function() {
18432
18434
  return this.participants.maxActiveParticipantsCount;
@@ -28450,7 +28452,7 @@ var gr = /* @__PURE__ */ w("trackMap"), m2 = /* @__PURE__ */ function(s) {
28450
28452
  }, { key: "setupContext", value: function(e, t, n, i) {
28451
28453
  var a, o, c = Aa.createContext(e, t), l = V(V({}, RP), t == null ? void 0 : t.modules), d = t.defaults || { audio: !0, video: !0 };
28452
28454
  return c.setValue("options", t), c.setValue("peerId", e), c.setValue("modules", l), c.setValue("sdkName", "web-core"), c.setValue("meetingId", n), c.setValue("apiBase", i.apiBase), c.setValue("baseURI", i.baseURI), c.setValue("userId", i.participantId), c.setValue("organizationId", i.orgId), c.setValue("authToken", t.authToken), c.setValue("overrides", (a = t.overrides) !== null && a !== void 0 ? a : {}), c.setValue("env", _P({ baseURI: i.baseURI })), c.setValue("defaults", d), c.setValue("onError", t.onError || function() {
28453
- }), c.setValue("cachedUserDetails", di(t.cachedUserDetails)), c.setValue("sdkVersion", "2.0.4-staging.1"), (o = t.modules) !== null && o !== void 0 && o.experimentalAudioPlayback && c.setValue("audioPlayback", new m2()), c;
28455
+ }), c.setValue("cachedUserDetails", di(t.cachedUserDetails)), c.setValue("sdkVersion", "2.0.4-staging.2"), (o = t.modules) !== null && o !== void 0 && o.experimentalAudioPlayback && c.setValue("audioPlayback", new m2()), c;
28454
28456
  } }]);
28455
28457
  }());
28456
28458
  Yl([dr("0002"), Xi.executeWithLock({ methodName: "meeting.join", lockName: "Client.join", timeout: 3e3 })], Ma.prototype, "join", 1);