2

私は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');
    }
})()

十分な情報を提供できたと思います!

4

2 に答える 2

1

FWIW、私がこれに戻ったとき、私は他の代替案を試すことに決めました、そして私はvideoJSが箱から出して完全に機能することを発見しました。

于 2013-01-09T04:45:43.947 に答える
0

たぶん、JsFiddleで簡単な例を提供する必要があります:http://jsfiddle.net/

実例がなければ、コードをテストするのは困難です。

それとは別に、私は次の行に気づきました:

name: 'itx-jPlayer-video',

これがあなたの指示だと思いますか?よくわかりませんが、「itxJPlayerVideo」ではないでしょうか。

ディレクティブには、ngBindなどのキャメルケースの名前があります。キャメルケース名をこれらの特殊文字:、-、または_を使用してスネークケースに変換することにより、ディレクティブを呼び出すことができます。

http://docs.angularjs.org/guide/directiveを参照してください

于 2012-12-20T11:52:11.973 に答える