Mar*_*ode 5 node.js requirejs brightcove video.js reactjs
我正在尝试在反应组件中使用require.ensure:
componentDidMount() {
require.ensure([], () => {
require('public/jscripts/brightcove/index.js');
});
}
Run Code Online (Sandbox Code Playgroud)
但不断收到错误: Cannot set property 'default' of undefined
它发生在brightcove videojs脚本中的这一点:
// At this point, `window.videojs` will be the earliest-defined copy of this
// version of videojs.
var videojs = window.videojs;
// https://github.com/videojs/video.js/issues/2698
videojs['default'] = videojs;
Run Code Online (Sandbox Code Playgroud)
有谁知道为什么会发生这种情况?
完整的脚本在这里顺便说一句,我把它保存为本地文件,因此路径public/jscripts/brightcove/index.js:https://players.brightcove.net/1752604059001/B1xXFuBodW_default/index.js
| 归档时间: |
|
| 查看次数: |
224 次 |
| 最近记录: |