我正在使用jQuery Youtube插件來嵌入YouTube視頻並在視頻中使用一些API方法。jquery youtube插件 - 調用方法
我有以下代碼:
<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>
此播放視頻很好,但是當影片結束,我期望的onPlayerEnded()
功能來踢,給我一個alert('Ended')
,這沒有關係」噸。
有沒有人在任何方向指出我使用過這個插件,爲什麼這是這種情況?
非常感謝
是它確定你把最後一個逗號在onPlayerEnded? – bondythegreat 2011-12-21 11:55:59
只有IE可能與最後一個逗號有問題 – 2011-12-21 11:57:33
IE 7,8和9都不顯示視頻。即使添加了SWFObject配置 – terrid25 2011-12-22 11:28:23