2011-12-21 5 views
0

私はjQuery Youtubeプラグインを使用してYouTube動画を埋め込み、ビデオでAPIメソッドを使用しています。jquery youtube plugin - calling methods

私は次のコードを持っている:

<div id="player"></div> 
<script type="text/javascript"> 
    jQuery("#player").tubeplayer({ 
     width: 600, // the width of the player 
     height: 450, // the height of the player 
     allowFullScreen: "true", // true by default, allow user to go full screen 
     initialVideo: "VIDEO_ID", // the video that is loaded into the player 
     preferredQuality: "default",// preferred quality: default, small, medium, large, hd720 
     onPlay: function(id){}, // after the play method is called 
     autoPlay: true, 
     onPause: function(){}, // after the pause method is called 
     onStop: function(){}, // after the player is stopped 
     onSeek: function(time){}, // after the video has been seeked to a defined point 
     onMute: function(){}, // after the player is muted 
     onUnMute: function(){}, // after the player is unmuted 
     onPlayerEnded: function(){alert('ENDED')}, 
    }); 
</script> 

「これは、ビデオの罰金を果たしているが、ビデオが終了したとき、私はキックと私に、それはdoesnのalert('Ended')を与えることonPlayerEnded()機能を期待しますt。

このプラグインを使用した人は誰ですか?なぜこのようなことが起こっているのですか?

感謝

+2

に動作しますが、それはあなたがonPlayerEndedにその最後のコンマを入れてOKですか? – bondythegreat

+0

IEのみが最後のカンマに問題がある可能性があります –

+0

IE 7,8,9はすべてビデオを表示しません。 SWFObject設定を追加しても – terrid25

答えて

0

それが正常に動作しますが、あなたのブラウザに問題がある可能性があり、警告の代わりにはconsole.log使用し、コンソールをチェックしてみてください。

私はjsfiddleにあなたのコードを入れて、それが http://jsfiddle.net/sabri/wHpmM/

+1

Chromeを使用すると問題が解決したようですが、今は警告が表示されています – terrid25

+1

これは、ubuntu 11.10のFireFox 8/9のバグです。それは奇妙なubuntuのFFではなく、Mac OS X 10.7とChromeとIEでFFに動作します。 – terrid25