aframe 禁用设备传感器弹出

aframe disable device sensors pop up

我最近使用 aframe 和 glitch 制作了一个网站,当网站出现故障时一切正常,但是一旦我上传到我的主机,每次都会出现一个弹出窗口,要求设备传感器许可 "access this site over HTTPS to enter VR mode and grant access to the device sensors."

你知道我怎样才能阻止这个弹出窗口出现吗?

谢谢

通过 HTTPS 为您的网站提供服务。 DeviceMotion 和 WebXR API 无法通过 HTTP

将此放入您的 CSS:

.a-modal {
    display: none!important;
}

您还可以通过使用以下配置将其停用来停用设备方向许可模式:

<a-scene device-orientation-permission-ui="enabled: false"></a-scene>

在文档中阅读更多相关信息: https://aframe.io/docs/1.1.0/components/device-orientation-permission-ui.html

请记住,您需要 1.0.0 或更高版本的框架。