Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>One issue is that addEvent is both a function that you've defined and also a method of the $f(player) object. It appears that you're confusing the two. The addEvent method of the $f(player) object only takes two arguments, the name of the player event and the function to be called. It should be used as $f(your-iframe).addEvent('vimeo event', your_function);</p> <p>Your addEvent function will unify events between IE and W3C methods. It's not needed because you're using jQuery. jQuery(whatever).click() does the same thing. I don't see any part of your snippet where you need it but if you do, I'd just use the jQuery method.</p> <p>Also, the video player object should be $f(player) instead of $f(player).vimeoPlayer</p> <p>Try this</p> <pre><code>jQuery('iframe.vimeo-player').each(function(){ $f(this).addEvent('ready', ready); }); </code></pre> <p>Another thing to note is that any additional player events need to be added from your ready callback function. For example:</p> <pre><code>function ready(player_id){ $f(player_id).addEvent('play', play); $f(player_id).api('play'); alert("Ready!!!"); } function play(){ alert("Playing!!!"); } </code></pre> <p>I've had a hard time finding the info I want on Vimeo's Froogaloop api but after scouring <a href="https://github.com/vimeo/player-api/blob/master/javascript/playground.html" rel="nofollow noreferrer">Vimeo Froogaloop API Playground</a> about a dozen times I'm starting to get the idea of how it works.</p> <p>Good luck!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload