gpt4 book ai didi

javascript - 将 Jplayer 视频播放与 Angular.JS 集成

转载 作者:行者123 更新时间:2023-11-30 05:52:37 25 4
gpt4 key购买 nike

我正在使用基于 angular.js 的框架。我需要播放视频,但根据我客户的规范,iframe 不在菜单中。

我正在尝试获取 jPlayer视频播放工作。我看过c0deformer's解决方案,我已经将它集成为音频播放器,但对于我的最新项目,他们肯定需要视频播放。当我启动 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');
}
})()

我希望我已经提供了足够的信息!

最佳答案

FWIW,当我回到这里时,我决定尝试其他替代方案,我发现 videoJS开箱即用。

关于javascript - 将 Jplayer 视频播放与 Angular.JS 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13792788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com