@defcomm/meetingsdk 0.5.3 → 0.5.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
@@ -12,8 +12,8 @@ import {
12
12
 
13
13
  // src/config/ws.ts
14
14
  var SDK_CONFIG = {
15
- apiBase: "https://sfu-server.duckdns.org/api",
16
- wsBase: "wss://sfu-server.duckdns.org/ws",
15
+ apiBase: "https://meetingsdk.defcomm.ng/api",
16
+ wsBase: "wss://meetingsdk.defcomm.ng/ws",
17
17
  // Public STUN/TURN servers (fallback)
18
18
  iceServers: [
19
19
  { urls: ["stun:stun.l.google.com:19302"] },
@@ -260,9 +260,9 @@ var MeetingState = class {
260
260
  cameraTrack: void 0,
261
261
  screenTrack: void 0,
262
262
  audioTrack: void 0,
263
- micEnabled: true,
264
- camEnabled: true,
265
- isScreenSharing: false,
263
+ micEnabled: p.media?.micEnabled ?? false,
264
+ camEnabled: p.media?.camEnabled ?? false,
265
+ isScreenSharing: p.media?.isScreenSharing ?? false,
266
266
  ...p.media,
267
267
  ...patch
268
268
  }
@@ -2241,10 +2241,24 @@ var VideoSDKCore = class {
2241
2241
  this.handleSFUState(state);
2242
2242
  },
2243
2243
  onConnected: (payload, resumed) => {
2244
- console.log(`[SFU] ${resumed ? "Resumed" : "Joined"} room`, payload);
2244
+ const local = (payload?.participants || []).find(
2245
+ (participant) => participant?.participant_id === this.myId
2246
+ );
2247
+ const permissions = local?.permissions ?? payload?.permissions ?? {};
2248
+ const isModerator = Boolean(permissions?.moderate);
2249
+ const isHost = Boolean(
2250
+ local?.is_host ?? local?.isHost ?? permissions?.host
2251
+ );
2245
2252
  this.state.updateLocalParticipant({
2246
2253
  id: this.myId,
2247
- name: this.participantName
2254
+ name: local?.user_metadata?.name,
2255
+ isHost,
2256
+ isModerator,
2257
+ permissions,
2258
+ media: {
2259
+ micEnabled: !Boolean(local?.audio_muted),
2260
+ camEnabled: !Boolean(local?.video_muted)
2261
+ }
2248
2262
  });
2249
2263
  },
2250
2264
  onDisconnected: () => {
@@ -2363,7 +2377,13 @@ var VideoSDKCore = class {
2363
2377
  onParticipantPermissionsChanged: (participantId, permissions) => {
2364
2378
  if (participantId === this.myId) {
2365
2379
  const current = this.state.localParticipant;
2366
- this.state.updateLocalParticipant({ id: this.myId, name: this.participantName, isHost: current?.isHost, isModerator: Boolean(permissions?.moderate), permissions });
2380
+ this.state.updateLocalParticipant({
2381
+ id: this.myId,
2382
+ name: this.participantName,
2383
+ isHost: current?.isHost,
2384
+ isModerator: Boolean(permissions?.moderate),
2385
+ permissions
2386
+ });
2367
2387
  }
2368
2388
  },
2369
2389
  onJoinRequested: (request) => {