<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Blog &#187; youtube</title>
	<atom:link href="http://www.techfromhel.com/tag/youtube/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.techfromhel.com</link>
	<description>Information Technology - our Life</description>
	<lastBuildDate>Tue, 26 Jul 2011 13:21:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>YouTube in a Thickbox</title>
		<link>http://www.techfromhel.com/2008/05/youtube-video-thickbox/</link>
		<comments>http://www.techfromhel.com/2008/05/youtube-video-thickbox/#comments</comments>
		<pubDate>Fri, 30 May 2008 13:54:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[thickbox]]></category>
		<category><![CDATA[video embed]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.techfromhel.com/?p=4</guid>
		<description><![CDATA[Embedding Videos: YouTube in a Thickbox <p>Note: This is a duplicate of an article I originally wrote on April 29, 2008 on the <a href="http://www.supernaturalstation.org/tech-tools/youtube-video-thickbox/">Supernatural Station website</a>.</p> <p>“Thickbox” is a great way to showcase a youTube video on your web site. Thickbox’s light box effect gives videos a dramatic, theatre-like feel. You only need to [...]]]></description>
			<content:encoded><![CDATA[<div>
<h3>Embedding Videos: YouTube in a Thickbox</h3>
<p>Note: This is a duplicate of an article I originally wrote on April 29, 2008 on the <a href="http://www.supernaturalstation.org/tech-tools/youtube-video-thickbox/">Supernatural Station website</a>.</p>
<p>“Thickbox” is a great way to showcase a youTube video on your web  site.  Thickbox’s light box effect gives videos a dramatic, theatre-like  feel. You only need to add a few extra lines of code to the preset  embed code supplied by YouTube.com to show your video inside a  “thickbox”. This method works with embed code from youTube.com as well  as embed code from other video hosting sites.</p>
<h4>Step-by-step Instructions to embed a youTube video inside a Thickbox:</h4>
<ul>
<li>
<h4>Step #1: Download and install jQuery.js and Thickbox 3.</h4>
<p>Download “jquery.js” from <a href="http://docs.jquery.com/Downloading_jQuery">jquery.com</a> and Thickbox3 files, “thickbox.js”, “thickbox.css”, “loadingAnimation.gif”, and “macFFhack.png”, from <a href="http://jquery.com/demo/thickbox/">jquery.com/demo/thickbox/</a>. You then need to upload these files to your web server’s root directory or a subdirectory.</p>
<p>You can skip this step, if “thickbox” came preinstalled with your CMS  or blog software, or if you installed a “thickbox” plugin on your site.  Please note that if your copy of “Thickbox” came from a gallery plugin,  some “thickbox” files may have been altered for that plugin. This can  lead to unexpected problems in Internet Explorer. I recommend you  install an unaltered copy of “thickbox” on your web server, if you  experience Thickbox problems in IE6 or IE7. Just make sure your version  of “thickbox” is placed last in the document head as shown in step #3  below.</li>
<li>
<h4>Step #2: Enter a valid DTD on the first line of your html document.</h4>
<p>Thickbox requires a valid document type definition (DTD) in the xhtml  document. Most CMS and blog software will automatically put this in for  you. However, if you are writing your document from scratch, then you  must include a DTD line above your opening &lt;html&gt; tag. If you  don’t know what DTD to add, the following code will work for most  documents:</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;</p></blockquote>
<p>For a list of other DTD&#8217;s, visit <a href="http://www.w3.org/QA/2002/04/valid-dtd-list.html">w3.org DTD recommendation</a> page.</li>
<li>
<h4>Step #3: Add “jquery.js” and “thickbox” to your document head.</h4>
<p>Enter the following lines between the &lt;head&gt; and &lt;/head&gt; tags in your xhtml document:</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221; src=&#8221;jquery.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;thickbox/thickbox.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt; var tb_pathToImage = &#8221;thickbox/loadingAnimation.gif&#8221;;&lt;/script&gt;<br />
&lt;style type=&#8221;text/css&#8221; media=&#8221;screen&#8221;&gt;@import “thickbox/thickbox.css&#8221;;&lt;/style&gt;</p></blockquote>
<p>In line #3, “loadingAnimation.gif” is a transition  graphic that is displayed before the thickbox appears. You can leave  this out, but it is helpful for your visitors to see it when thickbox is  slow to load.</p>
<p>You can skip this step if “Thickbox” came  preinstalled with your CMS/blog software or in a plugin and is  automatically included in the document head and you don’t want to  override those settings.</li>
<li>
<h4>Step #4: Add a unique, hidden &lt;div&gt; in your document body and paste the video embed code inside it.</h4>
<p>In the body of your web page, create a hidden div with a unique id  (id=&#8221;youtubeplayer20&#8243;) and paste the &#8220;embed&#8221; code from youtube.com  between the &lt;div&gt; and &lt;/div&gt; tags. To hide the div from the  viewer until they  click the link specified in step #5 below, add the  style attribute, “style=display:none;” to the opening &lt;div&gt; tag.</p>
<blockquote><p>&lt;div id=&#8221;youtubeplayer-20&#8243; style=&#8221;display:none;&#8221;&gt;<br />
&lt;!&#8211; start embed code copied directly from youTube.com &#8211;&gt; &lt;object width=&#8221;425&#8243; height=&#8221;355&#8243;&gt;<br />
&lt;param name=&#8221;movie&#8221; value=&#8221;http://www.youtube.com/v/YsowqYWs7vU&amp;hl=en&#8221;&gt;&lt;/param&gt;<br />
&lt;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221;&gt;&lt;/param&gt;<br />
&lt;embed src=&#8221;http://www.youtube.com/v/YsowqYWs7vU&amp;hl=en&#8221; type=&#8221;application/x-shockwave-flash&#8221; wmode=&#8221;transparent&#8221; width=&#8221;425&#8243; height=&#8221;355&#8243;&gt;&lt;/embed&gt; &lt;/object&gt;<br />
&lt;!&#8211; end embed code copied directly from youTube.com &#8211;&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Jot down the video dimensions shown in the “embed” code as you will need them in the next step.</p>
<p><strong>NOTE</strong>: Some video hosting sites already put their  embed code inside a div (ex. DailyMotion.com). I recommend manually  removing that div and any extraneous text inside it and place only the  remaining &lt;object&gt;, &lt;param&gt; and &lt;embed&gt; portion inside  your hidden &lt;div&gt;.</p>
<p><strong>6/27/2008 UPDATE</strong>:  A flash rendering problem on Mac  OSX/Firefox1.5+ and Mac OSX/Camino1.6 causes the youTube video to get  covered up by the thickbox itself. To fix, remove the  ‘wmode=”transparent”‘ argument from YouTube&#8217;s &lt;embed&gt; tag. Keep it  in the &lt;param&gt; tag only.</li>
<li>
<h4>Step #5: Lastly, in your document body, create an inline &#8220;thickbox&#8221;  link that points to the unique id of the hidden div containing the video  embed code.</h4>
<p>Create a Thickbox link for your youTube video by placing anchor tags  (&lt;a&gt;&lt;/a&gt;) around some text or an image. Use the thickbox  inline anchor, &#8220;#TB_inline&#8221; for the &#8220;href&#8221; and append the thickbox  dimensions (&gt;=video size) and the unique id of the hidden div from  step#4 as “href” parameters (see <a href="http://jquery.com/demo/thickbox/">thickbox inline content instructions</a>). The link must have a class of “thickbox” and an optional title that is displayed as the Thickbox header.</p>
<pre> &lt;a href="#TB_inline?height=380&amp;width=425&amp;inlineId=youtubeplayer20"
    title="My youTube Video"&gt;
Click here to see my youTube video&lt;/a&gt;</pre>
<p>If you don’t know your video dimensions, they are included inside the “embed” code from youTube.</li>
<li>
<h4>And that’s it!</h4>
<p>Here&#8217;s the entire code in a sample web page:</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221; dir=&#8221;ltr&#8221;&gt;<br />
&lt;head&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/jquery.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221; src=&#8221;js/thickbox/thickbox.js&#8221;&gt;&lt;/script&gt;<br />
&lt;script type=&#8221;text/javascript&#8221;&gt; var tb_pathToImage = &#8221;thickbox/loadingAnimation.gif&#8221;;&lt;/script&gt;<br />
&lt;style type=&#8221;text/css&#8221; media=&#8221;screen&#8221;&gt;@import &#8220;js/thickbox/thickbox.css&#8221;;&lt;/style&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;h2&gt;YouTube Video in a Thickbox example&lt;/h2&gt;<br />
&lt;div id=&#8221;youtubeplayer-20&#8243; style=&#8221;display:none;&#8221;&gt;<br />
&lt;!&#8211; start embed code copied directly from youTube.com &#8211;&gt;<br />
&lt;object width=&#8221;425&#8243; height=&#8221;355&#8243;&gt;<br />
&lt;param name=&#8221;movie&#8221; value=&#8221;http://www.youtube.com/v/YsowqYWs7vU&amp;hl=en&#8221;&gt;&lt;/param&gt;<br />
&lt;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221;&gt;&lt;/param&gt;<br />
&lt;embed src=&#8221;http://www.youtube.com/v/YsowqYWs7vU&amp;hl=en&#8221; type=&#8221;application/x-shockwave-flash&#8221; width=&#8221;425&#8243; height=&#8221;355&#8243;&gt;&lt;/embed&gt;<br />
&lt;/object&gt;<br />
&lt;!&#8211; end embed code copied directly from youTube.com &#8211;&gt;<br />
&lt;/div&gt;<br />
&lt;a href=&#8221;#TB_inline?height=365&amp;width=425&amp;inlineId=youtubeplayer-20&#8243;    title=&#8221;My YouTube Video&#8221;&gt;<br />
Click here to see my youTube video&lt;/a&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>This method works in FF 1.5, FF 2, Safari 1.3*, Safari 3, and IE 6. I  have not tested it in other browsers, but it should work fine in any  modern browser.</p>
<p>*<small>Note for Safari 1 users: although this Thickbox “inline” demo  works in Safari 1.3, other types of Thickbox 3 functions will not work  when combined with any version of jquery  greater than version 1.1.2,  and the combination, jquery 1.1.3+thickbox3 will cause Safari 1.3 to  crash.</small></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.techfromhel.com/2008/05/youtube-video-thickbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

