@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.36 → 1.0.37
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.js +19 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52,6 +52,7 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
52
52
|
isLocal: true,
|
|
53
53
|
producers: new Map(),
|
|
54
54
|
consumers: new Map(),
|
|
55
|
+
currentChannel: "spatial",
|
|
55
56
|
};
|
|
56
57
|
// 4. Initialize room state
|
|
57
58
|
this.room = {
|
|
@@ -234,7 +235,10 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
234
235
|
this.emit("all-participants-update", normalizedParticipants);
|
|
235
236
|
// CRITICAL: After receiving channel data, update ALL mute states
|
|
236
237
|
// This ensures existing audio consumers get the correct mute state
|
|
237
|
-
console.log(
|
|
238
|
+
console.log(`[CHANNEL-DEBUG] all-participants-update: Received ${normalizedParticipants.length} participants`);
|
|
239
|
+
normalizedParticipants.forEach(p => {
|
|
240
|
+
console.log(` - ${p.participantId?.substring(0, 8)}: channel=${p.currentChannel || 'spatial'}`);
|
|
241
|
+
});
|
|
238
242
|
this.updateAllParticipantsMuteState();
|
|
239
243
|
});
|
|
240
244
|
this.socket.on("new-participant", (participantData) => {
|
|
@@ -325,15 +329,16 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
325
329
|
const participantChannel = participant.currentChannel || "spatial";
|
|
326
330
|
const myChannel = this.localParticipant?.currentChannel || "spatial";
|
|
327
331
|
const isInHuddle = participantChannel !== "spatial";
|
|
328
|
-
console.log(
|
|
329
|
-
console.log(`
|
|
330
|
-
console.log(`
|
|
332
|
+
console.log(`[CHANNEL-DEBUG] Setting up audio consumer:`);
|
|
333
|
+
console.log(` - Participant: ${participant.participantId?.substring(0, 8)}`);
|
|
334
|
+
console.log(` - My channel: ${myChannel}`);
|
|
335
|
+
console.log(` - Their channel: ${participantChannel}`);
|
|
331
336
|
// Setup spatial audio with full 3D positioning (disabled for huddle users)
|
|
332
337
|
await this.spatialAudioManager.setupSpatialAudioForParticipant(participant.participantId, track, isInHuddle // Disable spatial audio for huddle users
|
|
333
338
|
);
|
|
334
339
|
// CRITICAL: Mute if not in same channel
|
|
335
340
|
const shouldMute = myChannel !== participantChannel;
|
|
336
|
-
console.log(`
|
|
341
|
+
console.log(` - Should mute: ${shouldMute} (channels ${myChannel === participantChannel ? 'MATCH' : 'DIFFER'})`);
|
|
337
342
|
this.spatialAudioManager.setParticipantMuted(participant.participantId, shouldMute);
|
|
338
343
|
// Only update spatial audio position if NOT in huddle
|
|
339
344
|
if (!isInHuddle) {
|
|
@@ -448,16 +453,19 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
448
453
|
const myChannel = this.localParticipant?.currentChannel || "spatial";
|
|
449
454
|
const theirChannel = data.channelId || "spatial";
|
|
450
455
|
const shouldMute = myChannel !== theirChannel;
|
|
451
|
-
console.log(`
|
|
452
|
-
console.log(`
|
|
456
|
+
console.log(`[CHANNEL-DEBUG] participant-channel-changed:`);
|
|
457
|
+
console.log(` - Participant: ${participant.participantId?.substring(0, 8)}`);
|
|
458
|
+
console.log(` - My channel: ${myChannel}`);
|
|
459
|
+
console.log(` - Their new channel: ${theirChannel}`);
|
|
460
|
+
console.log(` - Should mute: ${shouldMute}`);
|
|
453
461
|
this.spatialAudioManager.setParticipantMuted(participant.participantId, shouldMute);
|
|
454
462
|
}
|
|
455
463
|
// Update local participant if it's them
|
|
456
464
|
if (this.localParticipant?.participantId === data.participantId && this.localParticipant !== null) {
|
|
457
|
-
console.log(`
|
|
465
|
+
console.log(`[CHANNEL-DEBUG] LOCAL USER changed channel to: ${data.channelId}`);
|
|
458
466
|
this.localParticipant.currentChannel = data.channelId;
|
|
459
467
|
// When LOCAL user changes channel, update ALL other participants' mute state
|
|
460
|
-
console.log(`
|
|
468
|
+
console.log(`[CHANNEL-DEBUG] Updating ALL participants mute state...`);
|
|
461
469
|
this.updateAllParticipantsMuteState();
|
|
462
470
|
}
|
|
463
471
|
this.emit("participant-channel-changed", data);
|
|
@@ -590,7 +598,7 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
590
598
|
if (!this.localParticipant || !this.room)
|
|
591
599
|
return;
|
|
592
600
|
const myChannel = this.localParticipant.currentChannel || "spatial";
|
|
593
|
-
console.log(
|
|
601
|
+
console.log(`[CHANNEL-DEBUG] updateAllParticipantsMuteState - My channel: ${myChannel}`);
|
|
594
602
|
this.room.participants.forEach((participant) => {
|
|
595
603
|
// Skip local participant (never hear yourself)
|
|
596
604
|
if (participant.participantId === this.localParticipant?.participantId) {
|
|
@@ -598,10 +606,9 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
598
606
|
}
|
|
599
607
|
const theirChannel = participant.currentChannel || "spatial";
|
|
600
608
|
const shouldMute = myChannel !== theirChannel;
|
|
601
|
-
console.log(`
|
|
609
|
+
console.log(` - ${participant.participantId?.substring(0, 8)}: channel=${theirChannel}, shouldMute=${shouldMute}`);
|
|
602
610
|
this.spatialAudioManager.setParticipantMuted(participant.participantId, shouldMute);
|
|
603
611
|
});
|
|
604
|
-
console.log(`✅ [updateAllParticipantsMuteState] Complete`);
|
|
605
612
|
}
|
|
606
613
|
async muteParticipant(participantId) {
|
|
607
614
|
if (!this.localParticipant || !this.room) {
|
package/package.json
CHANGED