title: Youtube api - stop video
body: <p>I need some help with Youtube API and embeded videos.
  I want to stop video when clicked on some element (div,link,td etc.). I am trying to get it work just for 1 video now, but the final function of this script should be to stop all videos loaded on current page. I have read thru the YT API documentation but Im really beginner in JS so its still quite hard to understand for me.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript" src="swfobject.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  
  &lt;a href="javascript:ytplayer.stopVideo()"&gt;Play&lt;/a&gt;
  &lt;br/&gt;
  &lt;iframe id="ytplayer" src="http://www.youtube.com/embed/8Ax-dAR3ABs?rel=0&amp;iv_load_policy=3&amp;showinfo=0&amp;enablejsapi=1&amp;version=3&amp;playerapiid=ytplayer" type="application/x-shockwave-flash" frameborder="0" allowscriptaccess="always"&gt;&lt;/iframe&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>thanks in advance for any advices</p>