Navigator.activeVRDisplays

翻译不完整。 请帮助我们翻译这篇文章!

这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

activeVRDisplaysNavigator 接口返回的数组中每个VRDisplay对象中的的只读属性(VRDisplay.ispresentingtrue).

语法

var myActiveDisplays = navigator.activeVRDisplays;

返回值

VRDisplay对象数组.

例子

function showActive() {
  var displays = navigator.activeVRDisplays;
  for(var i = 0; i < displays.length; i++) {
    console.log('Display ' + displays[i].displayId + ' is active.');
  }
}

浏览器兼容性

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
activeVRDisplays
ExperimentalDeprecated
Chrome No support NoEdge No support 15 — 79
Notes
No support 15 — 79
Notes
Notes WebVR content requires a Windows Mixed Reality headset or the Windows Mixed Reality Portal Simulator.
Firefox Full support 55
Notes
Full support 55
Notes
Notes Windows support was enabled in Firefox 55.
Full support 64
Notes
Notes macOS support was enabled in Firefox 64.
IE No support NoOpera No support NoSafari No support NoWebView Android No support 79 — 80Chrome Android No support 79 — 80
Notes
No support 79 — 80
Notes
Notes Supported only by Google Daydream.
Firefox Android Full support 55Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support 12.0 — 13.0
Notes
No support 12.0 — 13.0
Notes
Notes Supported only by Google Daydream.
Secure context required
ExperimentalDeprecated
Chrome No support NoEdge No support NoFirefox Full support 73IE No support NoOpera No support NoSafari No support NoWebView Android No support 79 — 80Chrome Android No support 79 — 80Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android No support 12.0 — 13.0

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.
See implementation notes.
See implementation notes.

相关链接