我正在使用基于 angular.js 的框架。我需要播放视频,并且 iframe 根据客户的规格不在菜单中。
我正在尝试让jPlayer视频播放正常工作。我见过c0deformer 的解决方案,我已经将它集成为音频播放器,但对于我的最新项目,他们肯定需要视频播放。当我启动我的 jPlayer 实例时,我收到以下错误:
pre-call ClosureCompiler.script:1
post-call ClosureCompiler.script:1
TypeError: Cannot read property 'childNodes' of undefined
at e (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:38:220)
at e (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:38:215)
at e (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:38:215)
at k (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:42:261)
at http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:46:471
at k (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:42:261)
at http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:46:458
at http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:91:245
at h (http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:75:256)
at http://arielsmamma/rsrc/3rdparty/angular-1.0.1.min.js:75:489 angular-1.0.1.min.js:60
pre-setmedia-call ClosureCompiler.script:1
post-setmedia-call
这是jPlayer代码:
(function()
{
itx.ns( 'ui.video.jPlayerVideo', jPlayerVideo, true );
itx.extend( jPlayerVideo, itx.Directive,
{
restrict: 'E',
replace: true,
name: 'itx-jPlayer-video',
scope: {
'src': '=',
'duration': '='
}
});
function jPlayerVideo($scope)
{
itx.Directive.apply( this, arguments );
var self = this;
console.log('pre-call');
$("#jp_container_1").jPlayer({
swfPath: '../rsrc/3rdparty/jplayer/',
solution: 'flash, html',
supplied: 'm4v',
ready: function () {
console.log('pre-setmedia-call');
$(this).jPlayer("setMedia", {
m4v: $scope.src
});
console.log('post-setmedia-call');
}
});
console.log('post-call');
}
})()
我希望我已经提供了足够的信息!