@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.1 → 1.0.3
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 +7 -1
- package/dist/index.js +12 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,13 @@ export declare class OdysseySpatialComms extends EventManager {
|
|
|
28
28
|
resumeAudio(): Promise<void>;
|
|
29
29
|
getAudioContextState(): AudioContextState;
|
|
30
30
|
produceTrack(track: MediaStreamTrack): Promise<any>;
|
|
31
|
-
updatePosition(position: Position, direction: Direction
|
|
31
|
+
updatePosition(position: Position, direction: Direction, spatialData?: {
|
|
32
|
+
cameraDistance?: number;
|
|
33
|
+
screenPos?: {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
} | null;
|
|
37
|
+
}): void;
|
|
32
38
|
updateMediaState(mediaState: MediaState): void;
|
|
33
39
|
setListenerPosition(position: Position, orientation: {
|
|
34
40
|
forwardX: number;
|
package/dist/index.js
CHANGED
|
@@ -148,17 +148,27 @@ class OdysseySpatialComms extends EventManager_1.EventManager {
|
|
|
148
148
|
}
|
|
149
149
|
return producer;
|
|
150
150
|
}
|
|
151
|
-
updatePosition(position, direction) {
|
|
151
|
+
updatePosition(position, direction, spatialData) {
|
|
152
152
|
if (this.localParticipant && this.room) {
|
|
153
153
|
this.localParticipant.position = position;
|
|
154
154
|
this.localParticipant.direction = direction;
|
|
155
|
-
|
|
155
|
+
const updateData = {
|
|
156
156
|
participantId: this.localParticipant.participantId,
|
|
157
157
|
conferenceId: this.room.id,
|
|
158
158
|
roomId: this.room.id,
|
|
159
159
|
position,
|
|
160
160
|
direction,
|
|
161
|
+
cameraDistance: spatialData?.cameraDistance,
|
|
162
|
+
screenPos: spatialData?.screenPos,
|
|
163
|
+
};
|
|
164
|
+
console.log("📤 [SDK → SERVER] Sending position update:", {
|
|
165
|
+
participantId: this.localParticipant.participantId,
|
|
166
|
+
position,
|
|
167
|
+
direction,
|
|
168
|
+
cameraDistance: spatialData?.cameraDistance,
|
|
169
|
+
screenPos: spatialData?.screenPos,
|
|
161
170
|
});
|
|
171
|
+
this.socket.emit("update-position", updateData);
|
|
162
172
|
}
|
|
163
173
|
}
|
|
164
174
|
updateMediaState(mediaState) {
|
package/package.json
CHANGED