@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.34 → 1.0.35

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -242,6 +242,8 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
242
242
  participant.userEmail = snapshot.userEmail;
243
243
  participant.isLocal =
244
244
  this.localParticipant?.participantId === snapshot.participantId;
245
+ // CRITICAL: Store channel data for huddle detection
246
+ participant.currentChannel = snapshot.currentChannel || "spatial";
245
247
  this.room?.participants.set(snapshot.participantId, participant);
246
248
  if (participant.isLocal) {
247
249
  this.localParticipant = participant;
@@ -259,11 +261,7 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
259
261
  : [];
260
262
  this.emit("all-participants-update", normalizedParticipants);
261
263
  });
262
- // Resume the consumer to start receiving media (non-blocking)
263
- this.mediasoupManager
264
- .resumeConsumer(consumer.id)
265
- .then(() => { })
266
- .catch((err) => { });
264
+ // DON'T resume yet! Resume AFTER setting up the audio pipeline
267
265
  let participant = this.room?.participants.get(data.participantId);
268
266
  // If participant doesn't exist yet, create it with the data from the event
269
267
  if (!participant && this.room) {
@@ -283,6 +281,8 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
283
281
  userName: data.userName,
284
282
  userEmail: data.userEmail,
285
283
  };
284
+ // Default to spatial channel if not specified
285
+ participant.currentChannel = "spatial";
286
286
  this.room.participants.set(data.participantId, participant);
287
287
  }
288
288
  if (participant) {
@@ -329,9 +329,23 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
329
329
  this.spatialAudioManager.updateSpatialAudio(participant.participantId, data.position);
330
330
  }
331
331
  }
332
+ // NOW resume the consumer after audio pipeline is ready
333
+ this.mediasoupManager
334
+ .resumeConsumer(consumer.id)
335
+ .then(() => {
336
+ console.log(`✅ Consumer ${consumer.id.substring(0, 8)} resumed for ${participant?.participantId?.substring(0, 8)}`);
337
+ })
338
+ .catch((err) => {
339
+ console.error(`❌ Failed to resume consumer ${consumer.id}:`, err);
340
+ });
332
341
  }
333
342
  else if (track.kind === "video") {
334
343
  participant.videoTrack = track;
344
+ // Resume video consumer immediately (no audio pipeline needed)
345
+ this.mediasoupManager
346
+ .resumeConsumer(consumer.id)
347
+ .then(() => { })
348
+ .catch((err) => { });
335
349
  }
336
350
  this.emit("consumer-created", {
337
351
  participant,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newgameplusinc/odyssey-audio-video-sdk-dev",
3
- "version": "1.0.34",
3
+ "version": "1.0.35",
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",