ios - ios 上没有移动 - aframe.io 示例运行,相同(?)代码不是?有什么不同?

标签 ios aframe

在 IOS 下,解决方案不再对运动使用react。

我的解决方案已经奏效,现在不再有效。

此外,带有 Glitsch 源代码的“hello world”示例(见下文)不再起作用,但如果您从 a-frame 起始页 ( https://aframe.io/examples/showcase/helloworld/ ) 调用该示例,它就起作用了。

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Hello, WebVR!Test VR</title>
    <meta name="description" content="Test VR">        
    <script src="https://aframe.io/aframe/dist/aframe-master.min.js" ></script>
  </head>
  <body>
    <a-scene background="color: yellow">
      <a-box position="-1 0.5 -3" rotation="0 45 0" color="#4CC3D9" shadow></a-box>
      <a-sphere position="0 1.25 -5" radius="1.25" color="#EF2D5E" shadow></a-sphere>
      <a-cylinder position="1 0.75 -3" radius="0.5" height="1.5" color="#FFC65D" shadow></a-cylinder>
      <a-plane position="0 0 -4" rotation="-90 0 0" width="4" height="4" color="#7BC8A4" shadow></a-plane>
    </a-scene>
  </body>
</html>

有什么不同?我必须做什么才能使我的解决方案再次在 IOS 下工作?

最佳答案

不幸的是,Chrome (m74+) 和 Safari (iOS 12.2+) 现在默认禁用传感器访问。用户必须手动启用设置:

  • chrome://flags/#enable-generic-sensor在 Chrome
  • Settings -> Safari -> Motion & Orientation Access在 Safari iOS

  • 内容也必须通过 https 提供。

    更多信息:https://github.com/aframevr/aframe/issues/3976

    关于ios - ios 上没有移动 - aframe.io 示例运行,相同(?)代码不是?有什么不同?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56322681/

    相关文章:

    ios - 单击 Objective-C 中的按钮时动态添加文本字段

    aframe - 如何将 JSON 数据加载到 A-Frame 组件中?

    javascript - A 形框架中的灯光根据与它们的距离而产生条纹伪影

    ionic-framework - (iOS) Navigator.mediaDevices 不存在于您的浏览器中,并出现 ionic 和 aframe 错误

    ios - 如何在按下时隐藏标签栏并在返回时显示标签栏

    iphone - SKPaymentQueue canMakePayments 返回 null

    aframe - 一个框架。滚轮滚动放大

    aframe 禁用设备传感器弹出

    ios - 从 iOS 应用程序中删除应用程序内购买选项

    iphone - 如何将本地视频文件嵌入到 Html 中以在 UIWebView 中播放?