@newgameplusinc/odyssey-audio-video-sdk-dev 1.0.0 → 1.0.2
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 +3 -1
- package/dist/index.js +10 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,7 +28,9 @@ 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
|
+
}): void;
|
|
32
34
|
updateMediaState(mediaState: MediaState): void;
|
|
33
35
|
setListenerPosition(position: Position, orientation: {
|
|
34
36
|
forwardX: number;
|
package/dist/index.js
CHANGED
|
@@ -148,17 +148,25 @@ 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
|
+
};
|
|
163
|
+
console.log("📤 [SDK → SERVER] Sending position update:", {
|
|
164
|
+
participantId: this.localParticipant.participantId,
|
|
165
|
+
position,
|
|
166
|
+
direction,
|
|
167
|
+
cameraDistance: spatialData?.cameraDistance,
|
|
161
168
|
});
|
|
169
|
+
this.socket.emit("update-position", updateData);
|
|
162
170
|
}
|
|
163
171
|
}
|
|
164
172
|
updateMediaState(mediaState) {
|
package/package.json
CHANGED