Open marwie opened 5 months ago
@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.
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. https://github.com/mrdoob/three.js/issues/27779#issuecomment-1969913807
Description
PositionlAudio is not working on vision OS (simulator) when entering VR
Reproduction steps
Code
https://github.com/needle-tools/three.js/commit/1064ee0fb487b2b0e208b5b1d6578473c6e4b137
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