@defcomm/meetingsdk 0.5.1 → 0.5.3
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.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +41 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +41 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -270,7 +270,7 @@ declare class VideoSDKCore {
|
|
|
270
270
|
rejectJoinRequest(requestId: string, reason?: string): Promise<void>;
|
|
271
271
|
cancelJoinRequest(requestId?: string): Promise<void | undefined>;
|
|
272
272
|
muteAllAudio(): Promise<void>;
|
|
273
|
-
|
|
273
|
+
muteParticipant(participantId: string): Promise<void>;
|
|
274
274
|
removeParticipant(participantId: string): Promise<void>;
|
|
275
275
|
getModerators(roomCode: string): Promise<any>;
|
|
276
276
|
addModerator(roomCode: string, userId: string): Promise<any>;
|
|
@@ -352,7 +352,7 @@ type MeetingContextValue = {
|
|
|
352
352
|
rejectJoinRequest: (requestId: string) => void;
|
|
353
353
|
cancelJoinRequest: (requestId?: string) => Promise<void> | undefined;
|
|
354
354
|
muteAllAudio: () => Promise<void>;
|
|
355
|
-
|
|
355
|
+
muteParticipant: (participantId: string) => Promise<void>;
|
|
356
356
|
removeParticipant: (participantId: string) => Promise<void>;
|
|
357
357
|
getModerators: (roomCode: string) => Promise<any> | undefined;
|
|
358
358
|
addModerator: (roomCode: string, userId: string) => Promise<any> | undefined;
|
|
@@ -428,7 +428,7 @@ declare const useMeeting: (handlers?: {
|
|
|
428
428
|
rejectJoinRequest: (requestId: string) => void;
|
|
429
429
|
cancelJoinRequest: (requestId?: string) => Promise<void> | undefined;
|
|
430
430
|
muteAllAudio: () => Promise<void>;
|
|
431
|
-
|
|
431
|
+
muteParticipant: (participantId: string) => Promise<void>;
|
|
432
432
|
removeParticipant: (participantId: string) => Promise<void>;
|
|
433
433
|
getModerators: (roomCode: string) => Promise<any> | undefined;
|
|
434
434
|
addModerator: (roomCode: string, userId: string) => Promise<any> | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -270,7 +270,7 @@ declare class VideoSDKCore {
|
|
|
270
270
|
rejectJoinRequest(requestId: string, reason?: string): Promise<void>;
|
|
271
271
|
cancelJoinRequest(requestId?: string): Promise<void | undefined>;
|
|
272
272
|
muteAllAudio(): Promise<void>;
|
|
273
|
-
|
|
273
|
+
muteParticipant(participantId: string): Promise<void>;
|
|
274
274
|
removeParticipant(participantId: string): Promise<void>;
|
|
275
275
|
getModerators(roomCode: string): Promise<any>;
|
|
276
276
|
addModerator(roomCode: string, userId: string): Promise<any>;
|
|
@@ -352,7 +352,7 @@ type MeetingContextValue = {
|
|
|
352
352
|
rejectJoinRequest: (requestId: string) => void;
|
|
353
353
|
cancelJoinRequest: (requestId?: string) => Promise<void> | undefined;
|
|
354
354
|
muteAllAudio: () => Promise<void>;
|
|
355
|
-
|
|
355
|
+
muteParticipant: (participantId: string) => Promise<void>;
|
|
356
356
|
removeParticipant: (participantId: string) => Promise<void>;
|
|
357
357
|
getModerators: (roomCode: string) => Promise<any> | undefined;
|
|
358
358
|
addModerator: (roomCode: string, userId: string) => Promise<any> | undefined;
|
|
@@ -428,7 +428,7 @@ declare const useMeeting: (handlers?: {
|
|
|
428
428
|
rejectJoinRequest: (requestId: string) => void;
|
|
429
429
|
cancelJoinRequest: (requestId?: string) => Promise<void> | undefined;
|
|
430
430
|
muteAllAudio: () => Promise<void>;
|
|
431
|
-
|
|
431
|
+
muteParticipant: (participantId: string) => Promise<void>;
|
|
432
432
|
removeParticipant: (participantId: string) => Promise<void>;
|
|
433
433
|
getModerators: (roomCode: string) => Promise<any> | undefined;
|
|
434
434
|
addModerator: (roomCode: string, userId: string) => Promise<any> | undefined;
|
package/dist/index.js
CHANGED
|
@@ -882,9 +882,15 @@ var SFUClient = class {
|
|
|
882
882
|
if (!participantId) break;
|
|
883
883
|
const participant = this.participants.get(participantId);
|
|
884
884
|
if (participant) {
|
|
885
|
-
this.participants.set(participantId, {
|
|
885
|
+
this.participants.set(participantId, {
|
|
886
|
+
...participant,
|
|
887
|
+
permissions: payload.permissions
|
|
888
|
+
});
|
|
886
889
|
}
|
|
887
|
-
this.onParticipantPermissionsChanged(
|
|
890
|
+
this.onParticipantPermissionsChanged(
|
|
891
|
+
participantId,
|
|
892
|
+
payload.permissions
|
|
893
|
+
);
|
|
888
894
|
break;
|
|
889
895
|
}
|
|
890
896
|
case "publish_answer": {
|
|
@@ -1799,30 +1805,48 @@ var SFUClient = class {
|
|
|
1799
1805
|
this.pendingJoinRequestId = null;
|
|
1800
1806
|
}
|
|
1801
1807
|
async muteAllAudio() {
|
|
1802
|
-
if (!this.send({ type: "mute_all_audio" }))
|
|
1808
|
+
if (!this.send({ type: "mute_all_audio" }))
|
|
1809
|
+
throw new Error("SFU signaling is not connected");
|
|
1803
1810
|
}
|
|
1804
|
-
async
|
|
1805
|
-
if (!
|
|
1811
|
+
async muteParticipant(participantId) {
|
|
1812
|
+
if (!participantId) throw new Error("participantId is required");
|
|
1813
|
+
if (!this.send({
|
|
1814
|
+
type: "mute_participant",
|
|
1815
|
+
payload: { participant_id: participantId }
|
|
1816
|
+
})) {
|
|
1817
|
+
throw new Error("SFU signaling is not connected");
|
|
1818
|
+
}
|
|
1806
1819
|
}
|
|
1807
1820
|
async removeParticipant(participantId) {
|
|
1808
1821
|
if (!participantId) throw new Error("participantId is required");
|
|
1809
|
-
if (!this.send({
|
|
1822
|
+
if (!this.send({
|
|
1823
|
+
type: "remove_participant",
|
|
1824
|
+
payload: { participant_id: participantId }
|
|
1825
|
+
})) {
|
|
1810
1826
|
throw new Error("SFU signaling is not connected");
|
|
1811
1827
|
}
|
|
1812
1828
|
}
|
|
1813
1829
|
async getModerators(roomCode) {
|
|
1814
|
-
return this.request(
|
|
1830
|
+
return this.request(
|
|
1831
|
+
`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`
|
|
1832
|
+
);
|
|
1815
1833
|
}
|
|
1816
1834
|
async addModerator(roomCode, userId) {
|
|
1817
|
-
return this.request(
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1835
|
+
return this.request(
|
|
1836
|
+
`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`,
|
|
1837
|
+
{
|
|
1838
|
+
method: "POST",
|
|
1839
|
+
body: JSON.stringify({ user_id: userId })
|
|
1840
|
+
}
|
|
1841
|
+
);
|
|
1821
1842
|
}
|
|
1822
1843
|
async removeModerator(roomCode, userId) {
|
|
1823
|
-
return this.request(
|
|
1824
|
-
|
|
1825
|
-
|
|
1844
|
+
return this.request(
|
|
1845
|
+
`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators/${encodeURIComponent(userId)}`,
|
|
1846
|
+
{
|
|
1847
|
+
method: "DELETE"
|
|
1848
|
+
}
|
|
1849
|
+
);
|
|
1826
1850
|
}
|
|
1827
1851
|
isSocketOpen() {
|
|
1828
1852
|
return this.ws?.readyState === WebSocket.OPEN;
|
|
@@ -2731,9 +2755,9 @@ var VideoSDKCore = class {
|
|
|
2731
2755
|
if (!this.sfuClient) throw new Error("SFU client is not connected");
|
|
2732
2756
|
return this.sfuClient.muteAllAudio();
|
|
2733
2757
|
}
|
|
2734
|
-
async
|
|
2758
|
+
async muteParticipant(participantId) {
|
|
2735
2759
|
if (!this.sfuClient) throw new Error("SFU client is not connected");
|
|
2736
|
-
return this.sfuClient.
|
|
2760
|
+
return this.sfuClient.muteParticipant(participantId);
|
|
2737
2761
|
}
|
|
2738
2762
|
async removeParticipant(participantId) {
|
|
2739
2763
|
if (!this.sfuClient) throw new Error("SFU client is not connected");
|
|
@@ -3183,7 +3207,7 @@ var MeetingProvider = ({
|
|
|
3183
3207
|
rejectJoinRequest: sdk.rejectJoinRequest.bind(sdk),
|
|
3184
3208
|
cancelJoinRequest: sdk.cancelJoinRequest.bind(sdk),
|
|
3185
3209
|
muteAllAudio: sdk.muteAllAudio.bind(sdk),
|
|
3186
|
-
|
|
3210
|
+
muteParticipant: sdk.muteParticipant.bind(sdk),
|
|
3187
3211
|
removeParticipant: sdk.removeParticipant.bind(sdk),
|
|
3188
3212
|
getModerators: sdk.getModerators.bind(sdk),
|
|
3189
3213
|
addModerator: sdk.addModerator.bind(sdk),
|