2

我正在努力使用 react 360 在我的手机上播放音频。通过阅读各种文档,我了解到为了在手机上播放音频,我需要制定一个 html 实体来创建用户交互。一旦用户通过单击按钮进行交互,音频应该能够在移动设备上播放。情况似乎并非如此。

在我的index.html文件中,我有以下代码:

<html>
  <head>
    <title>ExampleVR</title>
    <style>body { margin: 0; }</style>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
  </head>
  <body>
    <!-- Attachment point for your app -->

    <div id="container">


      <button id="enter" onclick="enterApp();">
        Click to Enter VR
      </button>


    </div>
    <script src="./client.bundle?platform=vr"></script>
    <script>
      // Initialize the React 360 application


      function enterApp() {
        React360.init(
          'index.bundle?platform=vr&dev=true',
          document.getElementById('container'),
          {
            assetRoot: 'static_assets/',
          }
        );  
      }


    </script>
  </body>
</html>

如您所见,我创建了一个 html 按钮,单击该按钮会加载我的 React 360 代码。但是,当我在手机中单击 aVrButton时,它仍然无法播放。我已按照文档中的建议进行操作,它适用于桌面上的所有浏览器,但移动设备除外。有谁知道如何解决这个问题?

4

1 回答 1

2

这是解决音频问题的解决方案:

https://github.com/facebook/react-360/issues/652

于 2019-02-03T03:40:12.390 回答