Dave Heavy Industries » youtube http://www.daveheavyindustries.com Dave Heavy Industries - blog Mon, 12 Aug 2013 00:24:10 +0000 en-US hourly 1 http://wordpress.org/?v=3.6 Youtube – Embed video on HTTPS site http://www.daveheavyindustries.com/2011/03/11/youtube-embed-video-on-https-site/ http://www.daveheavyindustries.com/2011/03/11/youtube-embed-video-on-https-site/#comments Fri, 11 Mar 2011 02:27:55 +0000 admin http://wp.daveheavyindustries.com/?p=139 Ever wanted to embed a youtube video on a https (SSL) site without a security warning?

Well, its really quite easy. Youtube were kind enough to re-work their embed method from an <object> to an <iframe></iframe> and now fully support HTTPS.

very simply, here's the html you need.

<iframe title="YouTube video player" width="1280" height="750" src="https://www.youtube.com/embed/XXXXXXXXXXXXXXXX?rel=0&amp;hd=1" frameborder="0" allowfullscreen></iframe>

XXXXXXXXXXXXXXXX - embed ID of the video. you can see this in the URL of the youtube video

https -  http or https, depending on if you're embedding from a HTTPS page or not (if the page is accessible via both http and https, use https to avoid an IE security warning)

?rel=0 - realated videos.. 0 = none, exclude or =1 for allow

hd=1 - high definition.. 1 = high def, 0 (or exclude) = standard

1280 - width (1280px in this case.. you probably want it smaller)

750 - height (750px in this case.. you probably want it smaller)

allowfullscreen - exclude if you don't want your users to be able to make fullscreen (self explanatory really)

 

]]>
http://www.daveheavyindustries.com/2011/03/11/youtube-embed-video-on-https-site/feed/ 1