Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You aren't showing what you tried that didn't work, but I'm feeling psychic today so here's a wild stab:</p> <p>YouTube is currently giving out embed links that look like this:</p> <pre><code>&lt;iframe width="640" height="360" src="//www.youtube.com/embed/sLAEg5aTXAE?feature=player_detailpage" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; </code></pre> <p>What's unusual about this is that the URL -- in the "src" attribute of the IFrame tag -- does not specify a protocol.</p> <p>The format of the src attribute above is a type of relative URL, called a <em>protocol-relative URL</em>, that allows the embed tag to work regardless of whether your page is being accessed with an http:// or https:// protocol. (You aren't allowed to mix these in a single page)</p> <p>However -- and I'm guessing this is where you're going wrong -- if you open an HTML5 file locally, and not through a web server, it has a file:// URL. Because relative URLs -- including this oddball protocol-relative URL -- always take their unspecified bits from the current page location, the full URL that is being calculated is invalid:</p> <p>file://www.youtube.com/embed/sLAEg5aTXAE?feature=player_detailpage</p> <p>To fix, just change the src attribute to specify the protocol, changing the relative URL into an absolute URL that works from a page served with both file:// and http:// protocols.</p> <pre><code>&lt;iframe width="640" height="360" src="http://www.youtube.com/embed/sLAEg5aTXAE?feature=player_detailpage" frameborder="0" allowfullscreen&gt;&lt;/iframe&gt; </code></pre> <p>The drawback is that you can't put this on a page being delivered over https.</p> <p>In the longer term you should get in the habit of testing from a real web server instead of a file URL. For a locally-installed test server, WAMP/MAMP is an easy and popular choice.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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