@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.29 → 1.0.31

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.ts CHANGED
@@ -48,34 +48,34 @@ export declare class OdysseySpatialComms extends EventManager {
48
48
  setListenerFromLSD(listenerPos: Position, cameraPos: Position, lookAtPos: Position): void;
49
49
  private listenForEvents;
50
50
  /**
51
- * Send private huddle invite to another participant
51
+ * Send huddle invite to another participant
52
52
  */
53
- sendPrivateHuddleInvite(toParticipantId: string): Promise<{
53
+ sendHuddleInvite(toParticipantId: string): Promise<{
54
54
  success?: boolean;
55
55
  inviteId?: string;
56
56
  huddleId?: string;
57
57
  error?: string;
58
58
  }>;
59
59
  /**
60
- * Accept private huddle invite
60
+ * Accept huddle invite
61
61
  */
62
- acceptPrivateHuddleInvite(inviteId: string): Promise<{
62
+ acceptHuddleInvite(inviteId: string): Promise<{
63
63
  success?: boolean;
64
64
  huddleId?: string;
65
65
  participants?: string[];
66
66
  error?: string;
67
67
  }>;
68
68
  /**
69
- * Reject private huddle invite
69
+ * Reject huddle invite
70
70
  */
71
- rejectPrivateHuddleInvite(inviteId: string): Promise<{
71
+ rejectHuddleInvite(inviteId: string): Promise<{
72
72
  success?: boolean;
73
73
  error?: string;
74
74
  }>;
75
75
  /**
76
- * Join group huddle
76
+ * Join huddle (anyone can join directly without invite)
77
77
  */
78
- joinGroupHuddle(): Promise<{
78
+ joinHuddle(): Promise<{
79
79
  success?: boolean;
80
80
  channelId?: string;
81
81
  error?: string;
package/dist/index.js CHANGED
@@ -314,11 +314,16 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
314
314
  return; // Exit early to prevent any audio processing
315
315
  }
316
316
  else {
317
- // Setup spatial audio with full 3D positioning
318
- await this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, track, false // Enable spatial audio
317
+ // Check if participant is in huddle - if so, skip spatial audio
318
+ const participantChannel = participant.currentChannel;
319
+ const isInHuddle = participantChannel === "odyssey-huddle";
320
+ // Setup spatial audio with full 3D positioning (disabled for huddle users)
321
+ await this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, track, isInHuddle // Disable spatial audio for huddle users
319
322
  );
320
- // Update spatial audio position for this participant
321
- this.spatialAudioManager.updateSpatialAudio(participant.participantId, data.position);
323
+ // Only update spatial audio position if NOT in huddle
324
+ if (!isInHuddle) {
325
+ this.spatialAudioManager.updateSpatialAudio(participant.participantId, data.position);
326
+ }
322
327
  }
323
328
  }
324
329
  else if (track.kind === "video") {
@@ -346,8 +351,13 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
346
351
  participant.userName = data.userName;
347
352
  if (data.userEmail !== undefined)
348
353
  participant.userEmail = data.userEmail;
349
- // Update spatial audio with BOTH position AND direction from socket
350
- this.spatialAudioManager.updateSpatialAudio(data.participantId, data.position, data.direction);
354
+ // Only update spatial audio if NOT in huddle
355
+ const participantChannel = participant.currentChannel;
356
+ const isInHuddle = participantChannel === "odyssey-huddle";
357
+ if (!isInHuddle) {
358
+ // Update spatial audio with BOTH position AND direction from socket
359
+ this.spatialAudioManager.updateSpatialAudio(data.participantId, data.position, data.direction);
360
+ }
351
361
  this.emit("participant-position-updated", participant);
352
362
  }
353
363
  });
@@ -367,8 +377,8 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
367
377
  this.emit("disconnected");
368
378
  });
369
379
  // ==================== HUDDLE EVENT LISTENERS ====================
370
- this.socket.on("private-huddle-invite-received", (data) => {
371
- this.emit("private-huddle-invite-received", data);
380
+ this.socket.on("huddle-invite-received", (data) => {
381
+ this.emit("huddle-invite-received", data);
372
382
  });
373
383
  this.socket.on("private-huddle-started", (data) => {
374
384
  // Update local participant channel
@@ -377,24 +387,33 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
377
387
  }
378
388
  this.emit("private-huddle-started", data);
379
389
  });
380
- this.socket.on("private-huddle-updated", (data) => {
390
+ this.socket.on("huddle-updated", (data) => {
381
391
  // Multi-person huddle update (member joined/left)
382
- this.emit("private-huddle-updated", data);
392
+ this.emit("huddle-updated", data);
383
393
  });
384
- this.socket.on("private-huddle-invite-rejected", (data) => {
385
- this.emit("private-huddle-invite-rejected", data);
394
+ this.socket.on("huddle-invite-rejected", (data) => {
395
+ this.emit("huddle-invite-rejected", data);
386
396
  });
387
- this.socket.on("private-huddle-ended", (data) => {
397
+ this.socket.on("huddle-ended", (data) => {
388
398
  // Update local participant back to spatial
389
399
  if (this.localParticipant && this.localParticipant !== null) {
390
400
  this.localParticipant.currentChannel = "spatial";
391
401
  }
392
- this.emit("private-huddle-ended", data);
402
+ this.emit("huddle-ended", data);
393
403
  });
394
404
  this.socket.on("participant-channel-changed", (data) => {
395
405
  const participant = this.room?.participants.get(data.participantId);
396
406
  if (participant) {
397
407
  participant.currentChannel = data.channelId;
408
+ // Toggle spatial audio based on channel
409
+ const isInHuddle = data.channelId === "odyssey-huddle";
410
+ // Update spatial audio bypass state for this participant
411
+ if (participant.audioTrack) {
412
+ this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, participant.audioTrack, isInHuddle // Disable spatial for huddle, enable for spatial
413
+ ).catch(err => {
414
+ console.error(`Failed to update spatial audio for ${participant.participantId}:`, err);
415
+ });
416
+ }
398
417
  }
399
418
  // Update local participant if it's them
400
419
  if (this.localParticipant?.participantId === data.participantId && this.localParticipant !== null) {
@@ -405,14 +424,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
405
424
  }
406
425
  // ==================== HUDDLE METHODS ====================
407
426
  /**
408
- * Send private huddle invite to another participant
427
+ * Send huddle invite to another participant
409
428
  */
410
- async sendPrivateHuddleInvite(toParticipantId) {
429
+ async sendHuddleInvite(toParticipantId) {
411
430
  if (!this.localParticipant || !this.room) {
412
431
  return { success: false, error: "Not in a room" };
413
432
  }
414
433
  return new Promise((resolve) => {
415
- this.socket.emit("send-private-huddle-invite", {
434
+ this.socket.emit("send-huddle-invite", {
416
435
  fromParticipantId: this.localParticipant.participantId,
417
436
  toParticipantId,
418
437
  roomId: this.room.id,
@@ -422,14 +441,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
422
441
  });
423
442
  }
424
443
  /**
425
- * Accept private huddle invite
444
+ * Accept huddle invite
426
445
  */
427
- async acceptPrivateHuddleInvite(inviteId) {
446
+ async acceptHuddleInvite(inviteId) {
428
447
  if (!this.localParticipant) {
429
448
  return { success: false, error: "Not in a room" };
430
449
  }
431
450
  return new Promise((resolve) => {
432
- this.socket.emit("accept-private-huddle-invite", {
451
+ this.socket.emit("accept-huddle-invite", {
433
452
  inviteId,
434
453
  participantId: this.localParticipant.participantId,
435
454
  }, (response) => {
@@ -438,14 +457,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
438
457
  });
439
458
  }
440
459
  /**
441
- * Reject private huddle invite
460
+ * Reject huddle invite
442
461
  */
443
- async rejectPrivateHuddleInvite(inviteId) {
462
+ async rejectHuddleInvite(inviteId) {
444
463
  if (!this.localParticipant) {
445
464
  return { success: false, error: "Not in a room" };
446
465
  }
447
466
  return new Promise((resolve) => {
448
- this.socket.emit("reject-private-huddle-invite", {
467
+ this.socket.emit("reject-huddle-invite", {
449
468
  inviteId,
450
469
  participantId: this.localParticipant.participantId,
451
470
  }, (response) => {
@@ -454,14 +473,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
454
473
  });
455
474
  }
456
475
  /**
457
- * Join group huddle
476
+ * Join huddle (anyone can join directly without invite)
458
477
  */
459
- async joinGroupHuddle() {
478
+ async joinHuddle() {
460
479
  if (!this.localParticipant || !this.room) {
461
480
  return { success: false, error: "Not in a room" };
462
481
  }
463
482
  return new Promise((resolve) => {
464
- this.socket.emit("join-group-huddle", {
483
+ this.socket.emit("join-huddle", {
465
484
  participantId: this.localParticipant.participantId,
466
485
  roomId: this.room.id,
467
486
  }, (response) => {
package/dist/types.d.ts CHANGED
@@ -56,4 +56,4 @@ export interface ParticipantsSnapshotEvent {
56
56
  }>;
57
57
  timestamp: number;
58
58
  }
59
- export type OdysseyEvent = "connected" | "disconnected" | "room-joined" | "all-participants-update" | "new-participant" | "participant-left" | "producer-created" | "consumer-created" | "participant-media-state-updated" | "participant-position-updated" | "error" | "private-huddle-invite-received" | "private-huddle-started" | "private-huddle-updated" | "private-huddle-invite-rejected" | "private-huddle-ended" | "participant-channel-changed";
59
+ export type OdysseyEvent = "connected" | "disconnected" | "room-joined" | "all-participants-update" | "new-participant" | "participant-left" | "producer-created" | "consumer-created" | "participant-media-state-updated" | "participant-position-updated" | "error" | "huddle-invite-received" | "private-huddle-started" | "huddle-updated" | "huddle-invite-rejected" | "huddle-ended" | "participant-channel-changed";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newgameplusinc/odyssey-audio-video-sdk-dev",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "Odyssey Spatial Audio & Video SDK using MediaSoup for real-time communication",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",