title: How to parse embedded videos from youtube, vimeo, etc
body: <p>I'm working with Ruby On Rails 2.3.8 and I'm using TinyMCE with image and video upload functionalities.</p>
  
  <p>I've figured out that when I insert a Vimeo video, it won't work, because it needs it's own iframe, as the following:</p>
  
  <pre><code>&lt;iframe src="http://player.vimeo.com/video/16430948" width="400" height="225" frameborder="0"&gt;&lt;/iframe&gt;&lt;p&gt;&lt;a href="http://vimeo.com/16430948"&gt;YOU! - Heart&lt;/a&gt; from &lt;a href="http://vimeo.com/user1842450"&gt;KUSKUS&lt;/a&gt; on &lt;a href="http://vimeo.com"&gt;Vimeo&lt;/a&gt;.&lt;/p&gt;
  </code></pre>
  
  <p>I'm now wondering how to show either youtube (which work just fine), vimeo, and other kind of embedded videos.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Searching on the internet I've found the following code, in the file <code>/plugins/media/media.js</code>, within <code>getType</code> function:</p>
  
  <pre><code>// Vimeo
  if ( v.match(/^http:\/\/(?:www\.){0,1}vimeo\.com\/(\d+)$/) ) {
      f.width.value = '400';
      f.height.value = '321';
      f.src.value = 'http://vimeo.com/moogaloop.swf?clip_id=' + v.match(/^http:\/\/(?:www\.){0,1}vimeo\.com\/(\d+)$/)[1];
      return 'flash';
  }   
  </code></pre>
  
  <p>But it's not working for me. At least, all I see is that it's treating it as it was a common flash video, instead of inserting an iframe on the html for playing it (as it's done when you click the "Embed" button at vimeo.com).</p>