A messy guide to setup your media streaming playground with Windows Server 2008, Windows Media Server and Silverlight!

Before you start, make sure you got the basics of how to build a Silverlight application nailed down. For me, the best place to learn was http://silverlight.net/quickstarts

Once you know what it takes to build a Silverlight page (and believe me it's not difficult at all ;) ) you can check this tutorial to learn how to build your own custom video player. In this example, you'll be referencing a local video but we'll fix that later once we have our streaming server set up. :) 

Alternatively, there's a painless way to create a Silverlight application using Microsoft Expression Blend 2 (AUGUST PREVIEW!! WOOT!!).

Select new project, and select Silverlight application. Select add existing Item and select some random video and press f5. This should launch a page playing your video. Take a peek at the XAML code and make sure you know where to find <MediaElement .../> you'll be editing this later to point to your streaming source.

Meanwhile, on the server side...

Download and install Windows Media Server for Windows Server (June CTP). You'll find instructions on how to install this on Windows Server 2008  here. One thing to note is that Windows Media Server will use port 80 by default, so if you have IIS on your server, just modify the port for Windows Media Server by doing the following:

1. Start Media Services Management Console

2. Select your server and click properties

3. Double click WMS HTTP Server Control Protocol and specify a port other than port 80 that's not in use, like say 443.

(credits to Dennis, he figured this part out when I couldn't get a successful stream into my Silverlight application)

Now that your server is set up, you can proceed to creating a publishing point and adding your media onto the streaming server. You can add local files as well as set your server up as a proxy for a live stream. More info about and on what you can do with Windows Media Server here and here.

Now all that's left for you to do is to link up the media element on your XAML file to your media server source simply by modifying the source property to your file on the server e.g:

<MediaElement x:Name="VideoPlayer" Source="mms://server:443/path/to/vid.wmv" Width="320" Height="240" />

Now when you view your page, you should be able to see your video stream down into your customized player!

P.S. For those who are interested, you can also now install Windows Media Server on a Server Core installation of Windows Server.

Published Saturday, July 28, 2007 7:31 PM by jocelyn