React 360:Safari无法找到变量:AudioContext

时间:2018-05-15 19:24:11

标签: safari audiocontext react-360 webkitaudiocontext

在Safari中使用react 360启动react实例时,我收到AudioContext错误。

我实例化如下:

import {ReactInstance} from 'react-360-web';

function init(bundle, parent, options = {}) {
  const r360 = new ReactInstance(bundle, parent, {
    fullScreen: true,
    ...options,
  });
}

window.React360 = {init};

捆绑包中的错误堆栈是:

1

  

n = new r.ReactInstance(e,t,babelHelpers.extends({                   fullScreen:!0               },o));

2

  

this.runtime = new U.default(this.scene,(0,o.default)(t),l),   this.vrState = new p.default,this.vrState.onDisplayChange(function(e)   {                       e? a.overlay.setVRButtonState(!0,"在VR",a.enterVR中查看):a.overlay.setVRButtonState(!1," No Headset",null)                   }),this.controls.addCameraController(new g.default(this._eventLayer)),this.controls.addCameraController(new   v.default(this._eventLayer)),this.controls.addCameraController(new   b.default(this._eventLayer)),this.controls.addEventChannel(new   L.default(this._eventLayer)),this.controls.addEventChannel(new   V.default(this._eventLayer)),this.controls.addEventChannel(new   P.default),this.controls.addEventChannel(新的H.default),   this.controls.addRaycaster(new z.default),   this.controls.addRaycaster(新的A.default(this._eventLayer)),   this.controls.addRaycaster(new Q.default(this._eventLayer))               }

3

  

"功能" == typeof a? this.context.registerModule(一(this.context))   :this.context.registerModule(a)

4

  

nativeModules:[new B.default(this.compositor.getEnvironment()),   function(e){                           var t = new T.default(e);                           返回a._audioModule = t,t                       },function(e){

5

  

返回a._audioCtx =新的AudioContext,a._audioData = {},a._handles =   {},a._loaders = {},a._rnctx = e,a ////////// --->>>无法找到   变量:AudioContext

如何正确使用React 360 for Safari?有没有办法关闭音频模块?

1 个答案:

答案 0 :(得分:0)

似乎已将其修复程序推送至React360存储库:

https://github.com/facebook/react-360/commit/06918baa2c41156a19d01dbe6cae4996be62e5ca