2
我试图在Vimeo视频的播放按钮被点击后调用一个功能。Vimeo play eventListener在播放按钮被点击之前触发
出于某种原因,在加载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!!!");
}
谢谢!