您的位置:首页 > 产品设计 > UI/UE

Support for AMD usage of jwplayer (require js)

2016-07-12 14:33 393 查看
使用require js 模块化代码时,其中播放器用的是jwplayer7.x 然后载入jwplayer.js后总是报license无效(license已经加入),最后在jwplayer官网论坛里找到问题:

The reason seems to be that the flash player needs access to
window.jwplayer
.
window.jwplayer
is not set when using AMD (or CommonJS), therefore the flash player doesn't work.

While waiting for a fix, a workaround is to simply set
window.jwplayer
in the app's code:

define(['jwplayer'], function (jwplayer) {
window.jwplayer = jwplayer;

...
})
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: