单击 Vimeo 视频上的播放按钮后,我正在尝试调用一个函数。
由于某种原因,该函数在 iframe 加载时调用,而不是在单击播放时调用。有人可以解释为什么吗?
这是我的代码:
// Enable the API on each Vimeo video
jQuery('iframe.vimeo').each(function(){
Froogaloop(this).addEvent('ready', ready);
});
function ready(playerID){
// Add event listerns
// http://vimeo.com/api/docs/player-js#events
Froogaloop(playerID).addEvent('play', play(playerID));
}
function play(playerID){
alert(playerID + " is playing!!!");
}
谢谢!