<?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>Corey Schuman &#187; example</title>
	<atom:link href="http://www.85turns.com/tag/example/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.85turns.com</link>
	<description>Silverlight Consultant</description>
	<lastBuildDate>Tue, 26 Apr 2011 20:57:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Create a video player in Silverlight 2 &#8211; Part 1</title>
		<link>http://www.85turns.com/2008/04/02/create-a-video-player-silverlight-2-part-1/</link>
		<comments>http://www.85turns.com/2008/04/02/create-a-video-player-silverlight-2-part-1/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 03:37:36 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[MediaElement]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[Video player]]></category>

		<guid isPermaLink="false">http://simplesilverlight.wordpress.com/?p=46</guid>
		<description><![CDATA[Creating a video player in Silverlight is pretty simple. The MediaElement does all the heavy lifting, all you need to do is wire up a UI and you have a basic Video player. Here is a tutorial on how to create a simple video player from scratch using Silverlight 2. Create a Silverlight application Add [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a video player in Silverlight is pretty simple.  The MediaElement does all the heavy lifting, all you need to do is wire up a UI and you have a basic Video player.  Here is a tutorial on how to create a simple video player from scratch using Silverlight 2.</p>
<ol>
<li>Create a Silverlight application</li>
<li>Add a video to the project.  This is for testing purposes only.  Later in part 2 we will use a streaming video.</li>
<li>Add a MediaElement and a Toggle button for Play/Pause of the video.<strong>XAML</strong><br />
<a title="XAML Play Pause toggle button" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-playpause1.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-playpause1.png" alt="XAML Play Pause toggle button" /></a></p>
<p><strong>C#</strong><br />
<a title="C# Play Pause Toggle button" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-cs-playpausebutton.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-cs-playpausebutton.png" alt="C# Play Pause Toggle button" /></a></li>
<li>Add a Slider to show the position of the video.  To show the progress of the video on the slider, we will need to create a DispatcherTimer.  On the Tick event we will update the value of the slider.  In this example I have set the value of the Tick to 50 milliseconds.  There is minor jumping; if you want to get seamless indicator movment try going under 41 milliseconds.  We also need to Start and Stop the timer.  I am doing this on CurrentStateChanged event of the MediaElement.<strong>XAML</strong><br />
<a title="XAML slider" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-scrubber.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-scrubber.png" alt="XAML slider" /></a></p>
<p><strong>C#</strong><br />
<a title="C# Scrubber" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-scrubber.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-scrubber.png" alt="C# Scrubber" /></a></li>
<li>Add a TextBlock to show the exact position of the video.  To update the text, I am adding this to the Tick event of the timer.<strong>XAML</strong><br />
<a title="XAML Video position text" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-duration.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-xaml-duration.png" alt="XAML Video position text" /></a></p>
<p><strong>C#</strong><br />
<a title="C# Video position text" href="http://simplesilverlight.files.wordpress.com/2008/04/part1-duration.png"><img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-duration.png" alt="C# Video position text" /></a></li>
<li>Screen shot of the player at the end of Part 1<br />
<img src="http://simplesilverlight.files.wordpress.com/2008/04/part1-final.png" alt="Part 1 screen shot" /></li>
</ol>
<p><strong>Links</strong><br />
<a title="http://silverlight.peterpancomplex.net/zip/VideoPlayer.zip" href="http://silverlight.peterpancomplex.net/zip/VideoPlayer.zip">Source</a> (11Mb because of the WMV)<br />
<a title="http://simplesilverlight.wordpress.com/2008/04/15/create-a-video-player-silverlight-2-part-2/" href="http://simplesilverlight.wordpress.com/2008/04/15/create-a-video-player-silverlight-2-part-2/">Part 2 of how to Create a video player in Silverlight 2</a></p>
<h2><span style="color:#800000;">UPDATE</span></h2>
<p>If you are having problems with the Slider not recoginzing MouseLeftButtonUp or MouseLeftButtonDown events, check out the <a href="http://simplesilverlight.wordpress.com/2008/09/09/video-slider-control/"><strong>VideoSlider</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.85turns.com/2008/04/02/create-a-video-player-silverlight-2-part-1/feed/</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
	</channel>
</rss>

