HTML: Markup language
CSS: Styling language
JavaScript: Scripting language
Web APIs: Programming interfaces
All web technology
Learn web development
Discover our tools
Get to know MDN better
此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。
View in English Always switch to English
Avoid using this feature in new projects. Development of the WebVR API halted in favor of WebXR. This feature may be a candidate for removal from web standards or browsers.>
Consider using the following features instead: WebXR.>
非标准: 该特性尚未标准化。我们不建议在生产环境中使用非标准特性,因为它们在浏览器中的支持有限,且可能发生变化或被移除。不过,在没有标准选项的特定情况下,它们可以作为合适的替代方案。
Navigator 接口的 getVRDisplays() 方法会返回兑现为 VRDisplay 对象数组的 promise,该数组代表连接到计算机的任何可用的 VR 显示器。
Navigator
getVRDisplays()
VRDisplay
无。
兑现为 VRDisplay 对象数组的 promise。
有关示例代码,请参见 VRDisplay。
此方法属于旧版的 WebVR API(已被 WebXR 设备 API 取代)。其不再处于标准化轨道。
由于并非所有浏览器都已实现新的 WebXR API,因此建议依赖框架(例如 A-Frame、Babylon.js 或 Three.js)或 polyfill 来开发可在所有浏览器中运行的 WebXR 应用程序 [1]。
启用 JavaScript 以查看此浏览器兼容性表。