@defcomm/meetingsdk 0.6.3 → 0.6.5

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.mjs CHANGED
@@ -816,8 +816,9 @@ var SFUClient = class {
816
816
  case "join_approved": {
817
817
  const requestId = payload.request_id || message.request_id;
818
818
  if (!requestId) break;
819
+ const participantId = payload.user_id || payload.participant_id || payload.participantId || payload.request?.user_id || payload.request?.participant_id;
819
820
  this.pendingJoinRequestId = requestId;
820
- this.onJoinApproved(requestId);
821
+ this.onJoinApproved(requestId, participantId);
821
822
  if (this.ws?.readyState === WebSocket.OPEN) {
822
823
  this.setState("joining");
823
824
  this.send({
@@ -840,9 +841,10 @@ var SFUClient = class {
840
841
  break;
841
842
  }
842
843
  case "join_rejected": {
843
- const requestId = payload.request_id || message.request_id;
844
+ const requestId = payload.request_id;
844
845
  const reason = payload.reason;
845
- this.onJoinRejected(requestId, reason);
846
+ const participantId = payload.user_id || payload.participant_id;
847
+ this.onJoinRejected(requestId, reason, participantId);
846
848
  this.pendingJoinRequestId = null;
847
849
  this.intentionalClose = true;
848
850
  this.failJoin(new Error(reason || "Join request rejected"));
@@ -1098,7 +1100,9 @@ var SFUClient = class {
1098
1100
  break;
1099
1101
  }
1100
1102
  case "hand_raised": {
1101
- const participantId = String(payload.participant_id ?? payload.participantId ?? "");
1103
+ const participantId = String(
1104
+ payload.participant_id ?? payload.participantId ?? ""
1105
+ );
1102
1106
  const raised = Boolean(payload.raised);
1103
1107
  if (participantId) this.onHandRaised(participantId, raised);
1104
1108
  break;
@@ -1106,7 +1110,9 @@ var SFUClient = class {
1106
1110
  case "network_quality": {
1107
1111
  const raw = payload.quality || payload;
1108
1112
  const quality = {
1109
- participant_id: String(raw.participant_id ?? this.currentParticipantId ?? this.participantId),
1113
+ participant_id: String(
1114
+ raw.participant_id ?? this.currentParticipantId ?? this.participantId
1115
+ ),
1110
1116
  quality: String(raw.quality ?? "unknown"),
1111
1117
  score: Number(raw.score ?? 0),
1112
1118
  recommended_action: String(raw.recommended_action ?? "maintain"),
@@ -1566,7 +1572,9 @@ var SFUClient = class {
1566
1572
  */
1567
1573
  async getMediaDevices() {
1568
1574
  if (!navigator.mediaDevices?.enumerateDevices) {
1569
- throw new Error("Media device enumeration is not supported on this device");
1575
+ throw new Error(
1576
+ "Media device enumeration is not supported on this device"
1577
+ );
1570
1578
  }
1571
1579
  return navigator.mediaDevices.enumerateDevices();
1572
1580
  }
@@ -1886,7 +1894,9 @@ var SFUClient = class {
1886
1894
  );
1887
1895
  const text = await response.text();
1888
1896
  if (!response.ok) {
1889
- throw new Error(`Meeting summary request failed: ${response.status} ${text}`);
1897
+ throw new Error(
1898
+ `Meeting summary request failed: ${response.status} ${text}`
1899
+ );
1890
1900
  }
1891
1901
  return JSON.parse(text);
1892
1902
  }
@@ -2530,36 +2540,36 @@ var VideoSDKCore = class {
2530
2540
  onJoinPending: (info) => {
2531
2541
  console.log("[SFU] Join request pending", info);
2532
2542
  },
2533
- onJoinApproved: (requestId) => {
2534
- console.log("[SFU] Join approved", requestId);
2543
+ onJoinApproved: (requestId, participantId) => {
2544
+ const targetParticipantId = participantId || this.myId;
2545
+ console.log("[SFU] Join approved", {
2546
+ requestId,
2547
+ participantId: targetParticipantId
2548
+ });
2535
2549
  this.events.onJoinApproved?.(requestId);
2536
2550
  this.events.onEntryResponded?.(
2537
2551
  {
2538
- participantId: this.myId,
2552
+ participantId: targetParticipantId,
2539
2553
  decision: "approved"
2540
2554
  },
2541
2555
  "approved"
2542
2556
  );
2543
2557
  },
2544
- onJoinRejected: (requestId, reason) => {
2545
- console.warn("[SFU] Join rejected", requestId, reason);
2558
+ onJoinRejected: (requestId, reason, participantId) => {
2559
+ const targetParticipantId = participantId || this.myId;
2560
+ console.warn("[SFU] Join rejected", {
2561
+ requestId,
2562
+ participantId: targetParticipantId,
2563
+ reason
2564
+ });
2546
2565
  this.events.onJoinRejected?.(requestId);
2547
2566
  this.events.onEntryResponded?.(
2548
2567
  {
2549
- participantId: this.myId,
2568
+ participantId: targetParticipantId,
2550
2569
  decision: "rejected"
2551
2570
  },
2552
2571
  "rejected"
2553
2572
  );
2554
- this.emitError(
2555
- "JOIN_REJECTED",
2556
- reason || "Your request to join was rejected",
2557
- {
2558
- requestId,
2559
- reason
2560
- },
2561
- false
2562
- );
2563
2573
  },
2564
2574
  onChatMessage: (message) => {
2565
2575
  const msg = {