title: Detect Flowplayer on page and add event listener
body: <p>I'm using the <a href="http://github.com/etianen/html5media" rel="nofollow noreferrer">html5media</a> library, which automatically replaces the HTML5 video tag on the page with the Flowplayer Flash player for browsers that don't support the video tag. This happens on IE and some older browsers.</p>
  <p>I need to detect if the Flowplayer exists on the page and add an event listener to each instance that fires off a JavaScript function when the user starts playing a video. Is this possible via jQuery? The Flowplayer's Player object's API is described <a href="http://flowplayer.org/documentation/api/player.html" rel="nofollow noreferrer">here</a>; some examples:</p>
  <pre><code>/* Set common clip properties and event listeners
   * in run-time
   */
  
  // register event listener with common clip
  $f(&quot;player&quot;).onStart(function() {
    alert(&quot;Playing&quot;);
  });
  
  // this does the same thing
  $f(&quot;player&quot;).getCommonClip().onStart(function() {
    alert(&quot;Playing&quot;);
  });
  
  // if you want to register a listener to a specific clip *only*
  $f(&quot;player&quot;).getClip(1).onStart(function() {
    alert(&quot;Playing&quot;);
  });
  </code></pre>
  <p>How do you attach an event listener for the <code>onStart</code> event to each instance of the Flowplayer, if it exists on the page?</p>