-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PositionalAudio doesnt work on VisionOS in VR #27779
Comments
@mrdoob Do you happen to have any idea here? |
Hmm... If the Vision Pro is still at my desk tomorrow I'll have a look 👀 |
I tried this the other day. I think it has to be a Safari bug because I noticed the audio did get filtered when leaving VR. |
Thanks for trying. So you think it's a WebAudio bug on their end? Regular HTML audio elements continue playing just fine it seems. |
I think so yeah. |
OK, Ada confirmed it to be a bug and restarting the audio context is a workaround for now: Is it ok if I keep this issue open until the root cause is fixed, even with no actionable item on three.js side? |
That's okay 👍 |
Workaround a customer found today: const ctx = AudioContext.getContext();
ctx.addEventListener ("statechange", async () => {
if (ctx.state === "suspended" || ctx.state === "interrupted") {
ctx.resume().then(() => {
console. log("AudioContext resumed");
}).catch((err) => {
console.error ("AudioContext couldn't be resumed", err);
});
}
}); |
I'm doing some testing in the simulator and media stops immediately launching xr. And there is no controls to click to play. |
Would you mind trying again here? https://thankful-faint-coral.glitch.me/ |
In the webxr session start event, forcing video/audio element playback works. Now need to detect for visionOS to do that. actually you can't detect what platform visionOS is. navigator.platform reports Ipad. So have to check if it's Ipad in WebXR and force play. |
@danrossi you can add this code somewhere to work around this bug in VisionOS. No need for navigator checks. |
Description
PositionlAudio is not working on vision OS (simulator) when entering VR
Reproduction steps
Code
needle-tools@1064ee0
Live example
https://uploads.needle.tools/bugreports/threejs%20positional%20audio/examples/webaudio_orientation
Screenshots
No response
Version
160
Device
Headset
Browser
Safari
OS
No response
The text was updated successfully, but these errors were encountered: