﻿<?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>Mark van Aalst &#187; video</title>
	<atom:link href="http://www.markvanaalst.net/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markvanaalst.net</link>
	<description>blogging about ASP.Net and web development related techniques</description>
	<lastBuildDate>Thu, 18 Feb 2010 18:12:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Embedding video in Sitecore items</title>
		<link>http://www.markvanaalst.net/2009/08/07/embedding-video-in-sitecore-items/</link>
		<comments>http://www.markvanaalst.net/2009/08/07/embedding-video-in-sitecore-items/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 12:26:33 +0000</pubDate>
		<dc:creator>Mark</dc:creator>
				<category><![CDATA[Custom field]]></category>
		<category><![CDATA[Sitecore]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[Sitecore 6]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.markvanaalst.net/?p=34</guid>
		<description><![CDATA[These days streaming video on the web is quite popular. In almost every project we do at Evident Interactive the customer wants to embed video in content items. Off course they can do that by copy-pasting the embedding code in a Sitecore field or in the rich-text editor. But that is not the most user-friendly [...]]]></description>
			<content:encoded><![CDATA[<p>These days streaming video on the web is quite popular. In almost every project we do at <a href="http://www.evident.nl" target="_blank">Evident Interactive</a> the customer wants to embed video in content items. Off course they can do that by copy-pasting the embedding code in a Sitecore field or in the rich-text editor. But that is not the most user-friendly method. I thought it would be nice if an end-user could just copy-paste the url of the page and let an custom control do the rest. So I created a custom field, webcontrol, some xsl extensions an a addition to the flashmanager. Let&#8217;s say that we want to embed this <a href="http://www.youtube.com/watch?v=MKPmrwGuEkQ" target="_blank">video</a> from YouTube. I go to the content editor and paste the url in a field of the type &#8220;Video Embed&#8221;.</p>
<p><img class="size-full wp-image-36" title="Custom field" src="http://www.markvanaalst.net/files/2009/08/video_field.jpg" alt="Custom field" width="393" height="63" /><br />
<span id="more-34"></span> When I want to double check if I pasted the correct url I can click preview. A popup appears with the embedded video.</p>
<p><img class="alignnone size-full wp-image-38" title="Preview" src="http://www.markvanaalst.net/files/2009/08/video_preview.jpg" alt="Preview" width="442" height="329" /></p>
<p>Then I can save my item and publish it to the web database. The only thing saved in Sitecore is the url to the page containing the video.</p>
<p>But sometimes you want to embed video in to an rich text field. For this I wrote an extension for the flashmanager. It works the same as the custom field, the only thing different is you get a preview inside the tab and the embed code will be copied to to rich-text editor value.</p>
<p><img class="alignnone size-full wp-image-37" title="video_flashmanager" src="http://www.markvanaalst.net/files/2009/08/video_flashmanager.jpg" alt="video_flashmanager" width="441" height="311" /></p>
<p>To show my video in the frontend of the site I need to add an custom control to my layout or sublayout. The custom control is included in the package.</p>
<p>You need to add a page directive to your layout or sublayout</p>
<pre class="brush: csharp">
&lt;%@ Register TagPrefix=&quot;video&quot; Namespace=&quot;Sitecore.SharedSource.VideoEmbed&quot; Assembly=&quot;VideoEmbed&quot; %&gt;
</pre>
<p>Then you can add the custom control. You can set the height and width of the embed code. When those are left blank a default size of 240 for the height and 320 for the width will be used.</p>
<pre class="brush: csharp">
&lt;video:EmbedVideo id=&quot;VideoEmbed1&quot; runat=&quot;server&quot; Field=&quot;Video&quot; Height=&quot;240&quot; Width=&quot;320&quot;&gt;&lt;/video:EmbedVideo&gt;
</pre>
<p>And here is the result of the control</p>
<p><img class="alignnone size-full wp-image-44" title="Frontend" src="http://www.markvanaalst.net/files/2009/08/video_frontend.jpg" alt="Frontend" width="419" height="500" /></p>
<p>At the moment the solution works for YouTube, Vimeo and Google Video (international and dutch version). I will contribute this to the Shared Source section of Sitecore as soon as <a href="http://sharesitecore.wordpress.com/" target="_blank">Jimmie</a> is back from holiday and can give me access.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markvanaalst.net/2009/08/07/embedding-video-in-sitecore-items/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
