Fix remote voice negotiation and teleport cue timing
This commit is contained in:
@@ -160,9 +160,8 @@ export function createOnMessageHandler(deps: MessageHandlerDeps): (message: Inco
|
||||
deps.peerManager.setPeerPosition(message.id, message.x, message.y);
|
||||
if (peer) {
|
||||
const movementDelta = Math.hypot(message.x - prevX, message.y - prevY);
|
||||
const soundUrl = movementDelta > 1.5 ? deps.TELEPORT_START_SOUND_URL : deps.randomFootstepUrl();
|
||||
if (deps.getAudioLayers().world) {
|
||||
deps.playRemoteSpatialStepOrTeleport(soundUrl, peer.x, peer.y);
|
||||
if (movementDelta <= 1.5 && deps.getAudioLayers().world) {
|
||||
deps.playRemoteSpatialStepOrTeleport(deps.randomFootstepUrl(), peer.x, peer.y);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -50,6 +50,9 @@ export class PeerManager {
|
||||
const stream = this.getLocalStream();
|
||||
if (stream) {
|
||||
stream.getTracks().forEach((track) => pc.addTrack(track, stream));
|
||||
} else {
|
||||
// Ensure initial offers still negotiate audio receive even before mic setup finishes.
|
||||
pc.addTransceiver('audio', { direction: 'sendrecv' });
|
||||
}
|
||||
|
||||
pc.onicecandidate = (event) => {
|
||||
|
||||
Reference in New Issue
Block a user