@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.29 → 1.0.30
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 +8 -8
- package/dist/index.js +20 -20
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
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
|
|
51
|
+
* Send huddle invite to another participant
|
|
52
52
|
*/
|
|
53
|
-
|
|
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
|
|
60
|
+
* Accept huddle invite
|
|
61
61
|
*/
|
|
62
|
-
|
|
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
|
|
69
|
+
* Reject huddle invite
|
|
70
70
|
*/
|
|
71
|
-
|
|
71
|
+
rejectHuddleInvite(inviteId: string): Promise<{
|
|
72
72
|
success?: boolean;
|
|
73
73
|
error?: string;
|
|
74
74
|
}>;
|
|
75
75
|
/**
|
|
76
|
-
* Join
|
|
76
|
+
* Join huddle (anyone can join directly without invite)
|
|
77
77
|
*/
|
|
78
|
-
|
|
78
|
+
joinHuddle(): Promise<{
|
|
79
79
|
success?: boolean;
|
|
80
80
|
channelId?: string;
|
|
81
81
|
error?: string;
|
package/dist/index.js
CHANGED
|
@@ -367,8 +367,8 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
367
367
|
this.emit("disconnected");
|
|
368
368
|
});
|
|
369
369
|
// ==================== HUDDLE EVENT LISTENERS ====================
|
|
370
|
-
this.socket.on("
|
|
371
|
-
this.emit("
|
|
370
|
+
this.socket.on("huddle-invite-received", (data) => {
|
|
371
|
+
this.emit("huddle-invite-received", data);
|
|
372
372
|
});
|
|
373
373
|
this.socket.on("private-huddle-started", (data) => {
|
|
374
374
|
// Update local participant channel
|
|
@@ -377,19 +377,19 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
377
377
|
}
|
|
378
378
|
this.emit("private-huddle-started", data);
|
|
379
379
|
});
|
|
380
|
-
this.socket.on("
|
|
380
|
+
this.socket.on("huddle-updated", (data) => {
|
|
381
381
|
// Multi-person huddle update (member joined/left)
|
|
382
|
-
this.emit("
|
|
382
|
+
this.emit("huddle-updated", data);
|
|
383
383
|
});
|
|
384
|
-
this.socket.on("
|
|
385
|
-
this.emit("
|
|
384
|
+
this.socket.on("huddle-invite-rejected", (data) => {
|
|
385
|
+
this.emit("huddle-invite-rejected", data);
|
|
386
386
|
});
|
|
387
|
-
this.socket.on("
|
|
387
|
+
this.socket.on("huddle-ended", (data) => {
|
|
388
388
|
// Update local participant back to spatial
|
|
389
389
|
if (this.localParticipant && this.localParticipant !== null) {
|
|
390
390
|
this.localParticipant.currentChannel = "spatial";
|
|
391
391
|
}
|
|
392
|
-
this.emit("
|
|
392
|
+
this.emit("huddle-ended", data);
|
|
393
393
|
});
|
|
394
394
|
this.socket.on("participant-channel-changed", (data) => {
|
|
395
395
|
const participant = this.room?.participants.get(data.participantId);
|
|
@@ -405,14 +405,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
405
405
|
}
|
|
406
406
|
// ==================== HUDDLE METHODS ====================
|
|
407
407
|
/**
|
|
408
|
-
* Send
|
|
408
|
+
* Send huddle invite to another participant
|
|
409
409
|
*/
|
|
410
|
-
async
|
|
410
|
+
async sendHuddleInvite(toParticipantId) {
|
|
411
411
|
if (!this.localParticipant || !this.room) {
|
|
412
412
|
return { success: false, error: "Not in a room" };
|
|
413
413
|
}
|
|
414
414
|
return new Promise((resolve) => {
|
|
415
|
-
this.socket.emit("send-
|
|
415
|
+
this.socket.emit("send-huddle-invite", {
|
|
416
416
|
fromParticipantId: this.localParticipant.participantId,
|
|
417
417
|
toParticipantId,
|
|
418
418
|
roomId: this.room.id,
|
|
@@ -422,14 +422,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
422
422
|
});
|
|
423
423
|
}
|
|
424
424
|
/**
|
|
425
|
-
* Accept
|
|
425
|
+
* Accept huddle invite
|
|
426
426
|
*/
|
|
427
|
-
async
|
|
427
|
+
async acceptHuddleInvite(inviteId) {
|
|
428
428
|
if (!this.localParticipant) {
|
|
429
429
|
return { success: false, error: "Not in a room" };
|
|
430
430
|
}
|
|
431
431
|
return new Promise((resolve) => {
|
|
432
|
-
this.socket.emit("accept-
|
|
432
|
+
this.socket.emit("accept-huddle-invite", {
|
|
433
433
|
inviteId,
|
|
434
434
|
participantId: this.localParticipant.participantId,
|
|
435
435
|
}, (response) => {
|
|
@@ -438,14 +438,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
438
438
|
});
|
|
439
439
|
}
|
|
440
440
|
/**
|
|
441
|
-
* Reject
|
|
441
|
+
* Reject huddle invite
|
|
442
442
|
*/
|
|
443
|
-
async
|
|
443
|
+
async rejectHuddleInvite(inviteId) {
|
|
444
444
|
if (!this.localParticipant) {
|
|
445
445
|
return { success: false, error: "Not in a room" };
|
|
446
446
|
}
|
|
447
447
|
return new Promise((resolve) => {
|
|
448
|
-
this.socket.emit("reject-
|
|
448
|
+
this.socket.emit("reject-huddle-invite", {
|
|
449
449
|
inviteId,
|
|
450
450
|
participantId: this.localParticipant.participantId,
|
|
451
451
|
}, (response) => {
|
|
@@ -454,14 +454,14 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
454
454
|
});
|
|
455
455
|
}
|
|
456
456
|
/**
|
|
457
|
-
* Join
|
|
457
|
+
* Join huddle (anyone can join directly without invite)
|
|
458
458
|
*/
|
|
459
|
-
async
|
|
459
|
+
async joinHuddle() {
|
|
460
460
|
if (!this.localParticipant || !this.room) {
|
|
461
461
|
return { success: false, error: "Not in a room" };
|
|
462
462
|
}
|
|
463
463
|
return new Promise((resolve) => {
|
|
464
|
-
this.socket.emit("join-
|
|
464
|
+
this.socket.emit("join-huddle", {
|
|
465
465
|
participantId: this.localParticipant.participantId,
|
|
466
466
|
roomId: this.room.id,
|
|
467
467
|
}, (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" | "
|
|
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