1

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

我这样实例化:

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

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

window.React360 = {初始化};

捆绑包中的错误堆栈是这样的:

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, "View in 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(new H.default), this.controls .addRaycaster(new z.default), this.controls.addRaycaster(new A.default(this._eventLayer)),this.controls.addRaycaster(new Q.default(this._eventLayer)) }

3.

“函数” == 类型 a ?this.context.registerModule(a(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.

return a._audioCtx = new AudioContext, a._audioData = {}, a._handles = {}, a._loaders = {}, a._rnctx = e, a /////////---> >>找不到变量:AudioContext

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

4

1 回答 1

1

看起来对此的修复已被推送到 React360 存储库:

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

于 2018-08-30T12:53:37.527 回答