【问题标题】:Get WebVR working with Chrome on Samsung S8让 WebVR 在三星 S8 上与 Chrome 一起使用
【发布时间】:2017-12-08 17:39:35
【问题描述】:

我发现许多网站表明 WebVR 从 56 版开始就可以在 Chrome 上运行。我的 Chrome v.62 在三星 S8 上运行(我什至尝试过 Chrome Canary v65),当我执行这样的简单示例代码时,它适用于实例:

https://github.com/mdn/webvr-tests/blob/master/basic-display-info/index.html

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width">

    <title>VRStageParameters basic test</title>

  </head>

  <body>
    <h1>VRStageParameters basic test</h1>

    <p id='toto'></p>
  </body>
  <script>
    var info = document.getElementById('toto');
    var vrDisplay;
    if(navigator.getVRDisplays) {
        reportStageParams();
    } else {
      info.innerHTML = 'WebVR API not supported by this browser.'
    }
    function reportStageParams() {
      info.innerHTML = 'IS WORKING SOMEHOW'
      navigator.getVRDisplays().then(function(displays) {
        vrDisplay = displays[0];
        var stageParams = vrDisplay.stageParameters;
        // stageParams is a VRStageParameters object
        if(stageParams === null) {
          info.textContent = 'Your VR Hardware does not support room-scale experiences.'
        } else {
          info.innerHTML = '<strong>Display stage parameters</strong>'
                       + '<br>Sitting to standing transform: ' + stageParams.sittingToStandingTransform
                       + '<br>Play area width (m): ' + stageParams.sizeX
                       + '<br>Play area depth (m): ' + stageParams.sizeY
        }
      });
    }
  </script>
</html>

我不断收到消息WebVR API not supported by this browser.??我不明白为什么。有设置 WebVR 经验的人可以告诉我我需要做什么才能使其工作吗?我使用的是最近的手机,最新版本的浏览器,所以似乎我需要在某些设置中的某处激活 WebVR,但在网络上找不到任何东西。

【问题讨论】:

标签: virtual-reality google-vr webvr


【解决方案1】:

事实上,这个问题被问到并且已经回答了(在某种程度上):

How to enable WebVR on Google Chrome?

奇怪的是,这确实是让 WebVR 工作的第一步,并且在大多数 WebVR 教程和官方网站中都没有解释......所以这里是:

你需要去 chrome://flags

然后向下滚动,直到找到 WebVR 特定功能并启用所需的功能。

【讨论】:

    猜你喜欢
    • 2018-07-14
    • 1970-01-01
    • 2019-03-09
    • 1970-01-01
    • 2017-12-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-26
    相关资源
    最近更新 更多