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 AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic support
Experimental
Chrome No support No
Notes
No support No
Notes
Notes Available on all platforms behind a flag, but currently only works on desktop in an experimental version of Chrome (other builds won't return any devices when Navigator.getVRDisplays() is invoked).
Edge Full support YesFirefox 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 Full support YesChrome Android Full support Yes
Notes
Full support Yes
Notes
Notes Currently supported only by Google Daydream.
Edge Mobile No support NoFirefox Android Full support 55Opera Android No support NoSafari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.

相关链接

文档标签和贡献者

此页面的贡献者: gdccwxx
最后编辑者: gdccwxx,