【问题标题】:React 360: Safari Can't find variable: AudioContextReact 360:Safari 找不到变量:AudioContext
【发布时间】:2018-05-15 19:24:10
【问题描述】:

在 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 = {init};

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

1.

n = new r.ReactInstance(e, t, babelHelpers.extends({ 全屏:!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(新 g.default(this._eventLayer)), this.controls.addCameraController(新 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(新 z.default), this.controls.addRaycaster(new A.default(this._eventLayer)), this.controls.addRaycaster(new Q.default(this._eventLayer)) }

3.

"function" == typeof a ? this.context.registerModule(a(this.context)) : this.context.registerModule(a)

4.

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

5.

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

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

【问题讨论】:

    标签: safari audiocontext react-360 webkitaudiocontext


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-22
      • 1970-01-01
      • 2023-03-18
      • 1970-01-01
      • 2018-06-09
      • 2013-12-11
      • 2021-01-21
      • 2019-07-28
      相关资源
      最近更新 更多