what's new in webxr support?
Generated on 7/31/2024
1 search
Apple introduced several new features and improvements for WebXR support at WWDC 2024. Here are the key highlights:
-
Immersive Virtual Reality in Safari on visionOS 2.0:
- Safari now supports immersive virtual reality experiences built with hardware-accelerated graphics through WebGL. This allows for cross-browser and cross-hardware compatibility with minimal changes. (Build immersive web experiences with WebXR)
-
User Privacy and Security:
- WebXR prioritizes user privacy and security. All WebXR content requires HTTPS to prevent man-in-the-middle attacks. Additionally, if WebXR content is embedded in an iframe, the parent page must include the
allow="xr-spatial-tracking"
attribute to prevent unauthorized VR experiences. (Build immersive web experiences with WebXR)
- WebXR prioritizes user privacy and security. All WebXR content requires HTTPS to prevent man-in-the-middle attacks. Additionally, if WebXR content is embedded in an iframe, the parent page must include the
-
Session Management:
- Developers can use the
isSessionSupported
method to check if an immersive VR session is supported. When requesting a session, developers can specify required and optional features, such as hand tracking. (Build immersive web experiences with WebXR)
- Developers can use the
-
Interaction Models:
- On visionOS, spatial inputs only reveal where the user was looking at the moment of a pinch, ensuring sensitive information is protected. Users can easily exit immersive experiences using system interactions like pressing the crown or using gestures. (Build immersive web experiences with WebXR)
-
Frame Loop and Reference Space:
- WebXR sessions provide their own
requestAnimationFrame
synced to the WebXR display, which is crucial for maintaining high frame rates. Developers can request a reference space to describe the origin of their coordinate system, such aslocal-floor
for standing experiences. (Build immersive web experiences with WebXR)
- WebXR sessions provide their own
-
Integration with Standard Web APIs:
- Even during WebXR sessions, developers can use standard web APIs like gamepad inputs, speech synthesis, and spatial audio to enhance the immersive experience. (Build immersive web experiences with WebXR)
-
Testing and Debugging:
- Developers can use the Vision Pro simulator to test WebXR projects, even if they don't own a Vision Pro device. This ensures compatibility with visionOS and new transient pointer inputs. (Build immersive web experiences with WebXR)
For a comprehensive overview, you can refer to the session Build immersive web experiences with WebXR.
Build immersive web experiences with WebXR
Discover how WebXR empowers you to add fully immersive experiences to your website in visionOS. Find out how to build WebXR experiences that take full advantage of the input capabilities of visionOS, and learn how you can use Simulator to test WebXR experiences on macOS.
Optimize for the spatial web
Discover how to make the most of visionOS capabilities on the web. Explore recent updates like improvements to selection highlighting, and the ability to present spatial photos and panorama images in fullscreen. Learn to take advantage of existing web standards for dictation and text-to-speech with WebSpeech, spatial soundscapes with WebAudio, and immersive experiences with WebXR.