@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.js +32 -22
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -847,8 +847,9 @@ var SFUClient = class {
|
|
|
847
847
|
case "join_approved": {
|
|
848
848
|
const requestId = payload.request_id || message.request_id;
|
|
849
849
|
if (!requestId) break;
|
|
850
|
+
const participantId = payload.user_id || payload.participant_id || payload.participantId || payload.request?.user_id || payload.request?.participant_id;
|
|
850
851
|
this.pendingJoinRequestId = requestId;
|
|
851
|
-
this.onJoinApproved(requestId);
|
|
852
|
+
this.onJoinApproved(requestId, participantId);
|
|
852
853
|
if (this.ws?.readyState === WebSocket.OPEN) {
|
|
853
854
|
this.setState("joining");
|
|
854
855
|
this.send({
|
|
@@ -871,9 +872,10 @@ var SFUClient = class {
|
|
|
871
872
|
break;
|
|
872
873
|
}
|
|
873
874
|
case "join_rejected": {
|
|
874
|
-
const requestId = payload.request_id
|
|
875
|
+
const requestId = payload.request_id;
|
|
875
876
|
const reason = payload.reason;
|
|
876
|
-
|
|
877
|
+
const participantId = payload.user_id || payload.participant_id;
|
|
878
|
+
this.onJoinRejected(requestId, reason, participantId);
|
|
877
879
|
this.pendingJoinRequestId = null;
|
|
878
880
|
this.intentionalClose = true;
|
|
879
881
|
this.failJoin(new Error(reason || "Join request rejected"));
|
|
@@ -1129,7 +1131,9 @@ var SFUClient = class {
|
|
|
1129
1131
|
break;
|
|
1130
1132
|
}
|
|
1131
1133
|
case "hand_raised": {
|
|
1132
|
-
const participantId = String(
|
|
1134
|
+
const participantId = String(
|
|
1135
|
+
payload.participant_id ?? payload.participantId ?? ""
|
|
1136
|
+
);
|
|
1133
1137
|
const raised = Boolean(payload.raised);
|
|
1134
1138
|
if (participantId) this.onHandRaised(participantId, raised);
|
|
1135
1139
|
break;
|
|
@@ -1137,7 +1141,9 @@ var SFUClient = class {
|
|
|
1137
1141
|
case "network_quality": {
|
|
1138
1142
|
const raw = payload.quality || payload;
|
|
1139
1143
|
const quality = {
|
|
1140
|
-
participant_id: String(
|
|
1144
|
+
participant_id: String(
|
|
1145
|
+
raw.participant_id ?? this.currentParticipantId ?? this.participantId
|
|
1146
|
+
),
|
|
1141
1147
|
quality: String(raw.quality ?? "unknown"),
|
|
1142
1148
|
score: Number(raw.score ?? 0),
|
|
1143
1149
|
recommended_action: String(raw.recommended_action ?? "maintain"),
|
|
@@ -1597,7 +1603,9 @@ var SFUClient = class {
|
|
|
1597
1603
|
*/
|
|
1598
1604
|
async getMediaDevices() {
|
|
1599
1605
|
if (!navigator.mediaDevices?.enumerateDevices) {
|
|
1600
|
-
throw new Error(
|
|
1606
|
+
throw new Error(
|
|
1607
|
+
"Media device enumeration is not supported on this device"
|
|
1608
|
+
);
|
|
1601
1609
|
}
|
|
1602
1610
|
return navigator.mediaDevices.enumerateDevices();
|
|
1603
1611
|
}
|
|
@@ -1917,7 +1925,9 @@ var SFUClient = class {
|
|
|
1917
1925
|
);
|
|
1918
1926
|
const text = await response.text();
|
|
1919
1927
|
if (!response.ok) {
|
|
1920
|
-
throw new Error(
|
|
1928
|
+
throw new Error(
|
|
1929
|
+
`Meeting summary request failed: ${response.status} ${text}`
|
|
1930
|
+
);
|
|
1921
1931
|
}
|
|
1922
1932
|
return JSON.parse(text);
|
|
1923
1933
|
}
|
|
@@ -2561,36 +2571,36 @@ var VideoSDKCore = class {
|
|
|
2561
2571
|
onJoinPending: (info) => {
|
|
2562
2572
|
console.log("[SFU] Join request pending", info);
|
|
2563
2573
|
},
|
|
2564
|
-
onJoinApproved: (requestId) => {
|
|
2565
|
-
|
|
2574
|
+
onJoinApproved: (requestId, participantId) => {
|
|
2575
|
+
const targetParticipantId = participantId || this.myId;
|
|
2576
|
+
console.log("[SFU] Join approved", {
|
|
2577
|
+
requestId,
|
|
2578
|
+
participantId: targetParticipantId
|
|
2579
|
+
});
|
|
2566
2580
|
this.events.onJoinApproved?.(requestId);
|
|
2567
2581
|
this.events.onEntryResponded?.(
|
|
2568
2582
|
{
|
|
2569
|
-
participantId:
|
|
2583
|
+
participantId: targetParticipantId,
|
|
2570
2584
|
decision: "approved"
|
|
2571
2585
|
},
|
|
2572
2586
|
"approved"
|
|
2573
2587
|
);
|
|
2574
2588
|
},
|
|
2575
|
-
onJoinRejected: (requestId, reason) => {
|
|
2576
|
-
|
|
2589
|
+
onJoinRejected: (requestId, reason, participantId) => {
|
|
2590
|
+
const targetParticipantId = participantId || this.myId;
|
|
2591
|
+
console.warn("[SFU] Join rejected", {
|
|
2592
|
+
requestId,
|
|
2593
|
+
participantId: targetParticipantId,
|
|
2594
|
+
reason
|
|
2595
|
+
});
|
|
2577
2596
|
this.events.onJoinRejected?.(requestId);
|
|
2578
2597
|
this.events.onEntryResponded?.(
|
|
2579
2598
|
{
|
|
2580
|
-
participantId:
|
|
2599
|
+
participantId: targetParticipantId,
|
|
2581
2600
|
decision: "rejected"
|
|
2582
2601
|
},
|
|
2583
2602
|
"rejected"
|
|
2584
2603
|
);
|
|
2585
|
-
this.emitError(
|
|
2586
|
-
"JOIN_REJECTED",
|
|
2587
|
-
reason || "Your request to join was rejected",
|
|
2588
|
-
{
|
|
2589
|
-
requestId,
|
|
2590
|
-
reason
|
|
2591
|
-
},
|
|
2592
|
-
false
|
|
2593
|
-
);
|
|
2594
2604
|
},
|
|
2595
2605
|
onChatMessage: (message) => {
|
|
2596
2606
|
const msg = {
|