@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.mjs CHANGED
@@ -852,9 +852,15 @@ var SFUClient = class {
852
852
  if (!participantId) break;
853
853
  const participant = this.participants.get(participantId);
854
854
  if (participant) {
855
- this.participants.set(participantId, { ...participant, permissions: payload.permissions });
855
+ this.participants.set(participantId, {
856
+ ...participant,
857
+ permissions: payload.permissions
858
+ });
856
859
  }
857
- this.onParticipantPermissionsChanged(participantId, payload.permissions);
860
+ this.onParticipantPermissionsChanged(
861
+ participantId,
862
+ payload.permissions
863
+ );
858
864
  break;
859
865
  }
860
866
  case "publish_answer": {
@@ -1769,30 +1775,48 @@ var SFUClient = class {
1769
1775
  this.pendingJoinRequestId = null;
1770
1776
  }
1771
1777
  async muteAllAudio() {
1772
- if (!this.send({ type: "mute_all_audio" })) throw new Error("SFU signaling is not connected");
1778
+ if (!this.send({ type: "mute_all_audio" }))
1779
+ throw new Error("SFU signaling is not connected");
1773
1780
  }
1774
- async unmuteAllAudio() {
1775
- if (!this.send({ type: "unmute_all_audio" })) throw new Error("SFU signaling is not connected");
1781
+ async muteParticipant(participantId) {
1782
+ if (!participantId) throw new Error("participantId is required");
1783
+ if (!this.send({
1784
+ type: "mute_participant",
1785
+ payload: { participant_id: participantId }
1786
+ })) {
1787
+ throw new Error("SFU signaling is not connected");
1788
+ }
1776
1789
  }
1777
1790
  async removeParticipant(participantId) {
1778
1791
  if (!participantId) throw new Error("participantId is required");
1779
- if (!this.send({ type: "remove_participant", payload: { participant_id: participantId } })) {
1792
+ if (!this.send({
1793
+ type: "remove_participant",
1794
+ payload: { participant_id: participantId }
1795
+ })) {
1780
1796
  throw new Error("SFU signaling is not connected");
1781
1797
  }
1782
1798
  }
1783
1799
  async getModerators(roomCode) {
1784
- return this.request(`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`);
1800
+ return this.request(
1801
+ `${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`
1802
+ );
1785
1803
  }
1786
1804
  async addModerator(roomCode, userId) {
1787
- return this.request(`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`, {
1788
- method: "POST",
1789
- body: JSON.stringify({ user_id: userId })
1790
- });
1805
+ return this.request(
1806
+ `${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators`,
1807
+ {
1808
+ method: "POST",
1809
+ body: JSON.stringify({ user_id: userId })
1810
+ }
1811
+ );
1791
1812
  }
1792
1813
  async removeModerator(roomCode, userId) {
1793
- return this.request(`${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators/${encodeURIComponent(userId)}`, {
1794
- method: "DELETE"
1795
- });
1814
+ return this.request(
1815
+ `${this.apiBase}/rooms/${encodeURIComponent(roomCode)}/moderators/${encodeURIComponent(userId)}`,
1816
+ {
1817
+ method: "DELETE"
1818
+ }
1819
+ );
1796
1820
  }
1797
1821
  isSocketOpen() {
1798
1822
  return this.ws?.readyState === WebSocket.OPEN;
@@ -2701,9 +2725,9 @@ var VideoSDKCore = class {
2701
2725
  if (!this.sfuClient) throw new Error("SFU client is not connected");
2702
2726
  return this.sfuClient.muteAllAudio();
2703
2727
  }
2704
- async unmuteAllAudio() {
2728
+ async muteParticipant(participantId) {
2705
2729
  if (!this.sfuClient) throw new Error("SFU client is not connected");
2706
- return this.sfuClient.unmuteAllAudio();
2730
+ return this.sfuClient.muteParticipant(participantId);
2707
2731
  }
2708
2732
  async removeParticipant(participantId) {
2709
2733
  if (!this.sfuClient) throw new Error("SFU client is not connected");
@@ -3153,7 +3177,7 @@ var MeetingProvider = ({
3153
3177
  rejectJoinRequest: sdk.rejectJoinRequest.bind(sdk),
3154
3178
  cancelJoinRequest: sdk.cancelJoinRequest.bind(sdk),
3155
3179
  muteAllAudio: sdk.muteAllAudio.bind(sdk),
3156
- unmuteAllAudio: sdk.unmuteAllAudio.bind(sdk),
3180
+ muteParticipant: sdk.muteParticipant.bind(sdk),
3157
3181
  removeParticipant: sdk.removeParticipant.bind(sdk),
3158
3182
  getModerators: sdk.getModerators.bind(sdk),
3159
3183
  addModerator: sdk.addModerator.bind(sdk),