title: Embedding youtube videos with jwplayer
body: <p>I wonder how to put Youtube videos to an html page. I've been searching for a few hours, here's what I tried:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
  &lt;head&gt;
  &lt;script type='text/javascript' src='Scripts/swfobject.js'&gt;&lt;/script&gt;
  &lt;script type='text/javascript'&gt;
    swfobject.registerObject("playerID", "9.0.0");
  &lt;/script&gt;
  &lt;script type='text/javascript' src='Scripts/mediaplayer/jwplayer.js'&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type='text/javascript' src='Scripts/mediaplayer/jwplayer.js'&gt;&lt;/script&gt;
  
  &lt;div id='mediaplayer'&gt;&lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
  
     var flashvars = {
        'file':   'http://www.youtube.com/watch?v=YE7VzlLtp-4',
        'controlbar':     'bottom'
     };
  
     var params = {
        'allowfullscreen':        'true',
        'allowscriptaccess':      'always'
     };
  
     var attributes = {
        'id':                     'playerID',
        'name':                   'playerID'
     };
  
     swfobject.embedSWF('Scripts/mediaplayer/player.swf', 'mediaplayer', '480', '360', '9', 'false', flashvars, params, attributes);
  
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>            &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
              &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
              &lt;head&gt;
              &lt;script type='text/javascript' src='./Scripts/swfobject.js'&gt;&lt;/script&gt;
              &lt;/head&gt;
              &lt;body&gt;
              &lt;script type='text/javascript' src='./Scripts/mediaplayer/jwplayer.js'&gt;&lt;/script&gt;
  
              &lt;div id='mediaspace'&gt;This text will be replaced&lt;/div&gt;
  
              &lt;script type='text/javascript'&gt;
                jwplayer('mediaspace').setup({
                  'flashplayer': './Scripts/mediaplayer/player.swf',
                  'file': 'http://www.youtube.com/v/K_sev04KfeU?version',
                  'controlbar': 'bottom',
                  'width': '470',
                  'height': '320'
                });
              &lt;/script&gt;
              &lt;/body&gt;
              &lt;/html&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>            &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  
              &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  
              &lt;head&gt;
              &lt;script type='text/javascript' src='./Scripts/mediaplayer/jwplayer.js'&gt;&lt;/script&gt;
  
              &lt;/head&gt;
              &lt;body&gt;
  
  
              &lt;div id='mediaplayer'&gt;&lt;/div&gt;
  
              &lt;script type="text/javascript"&gt;
                jwplayer('mediaplayer').setup({
                  'flashplayer': './Scripts/mediaplayer/player.swf',
                  'id': 'playerID',
                  'width': '480',
                  'height': '270',
                  'file': 'XSGBVzeBUbk',
                  'provider': 'youtube',
                  'plugins': {
                     'hd-2': {}
                  }
                });
              &lt;/script&gt;
  
              &lt;/body&gt;
              &lt;/html&gt;
  </code></pre>
  
  <p>and tens of variations (including registerObject)... I wonder if someone could give me an example .zip link.</p>