我有一个playcanvas经验,并在一个链接上托管。它使用陀螺仪进行vr体验。如果我直接在android设备中打开链接。它可以和陀螺仪一起工作。但是当我将链接嵌入到iframe中并在移动设备中打开该页面时。陀螺仪不工作了。我用来嵌入iframe的代码是:
<iframe id="the_iframe" class="bg" allowvr="yes" allow="vr; xr; accelerometer; magnetometer; gyroscope; autoplay;"
allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" frameborder="0"></iframe>发布于 2021-04-05 22:07:24
对我起作用的是将"webxr“添加到允许列表中。
<iframe id="the_iframe" class="bg" allowvr="yes" allow="vr; xr; accelerometer; magnetometer; gyroscope; webvr;webxr;"
allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true" frameborder="0"></iframe>尽管它适用于安卓系统。在ios设备中不起作用。
https://stackoverflow.com/questions/66949067
复制相似问题