Anyone checking out my last post might have noticed the rather nice looking silverlight player demoing the code... Whilst I can't claim responsibility for the xaml and design of the player, I did manage to create an extension which makes adding a player like this very simple. I was thinking of adding some video to the post to demonstrate the sample app so that interested, but not that interested, people could see what was going on without downloading the code and firing up VS. Looking around I found that someone had already made an FLV player extension but hey, this is a .NET blog and Blogengine.NET is written using Microsoft technology, why not go all the way?!
My extension works almost exactly like the FLV player one, adding a token like this: [ silverlight:somevideo.wmv ] (without the spaces!) will get you a silverlight video player.
Now given that Blogengine.NET 1.3 has just landed, it's only right that we find a use for the new ExtensionManager amongst all this. It's time now that I confess why I can't claim responsibility for the lovely xaml, I stole it! There are actually 14 video player templates which come with Expression Encoder and from what I can make out from the EULA, I'm not doing anything wrong by redistributing them (someone please correct me if I'm wrong!). So to that effect we have 14 different skins and also width and height adjustments, all configurable from within the Extensions admin menu.

The attached zip file contains a file, SilverlightPlayer.cs, this must be uploaded to your ~/App_Code/Extensions folder. The zip also contains a folder, SilverlightPlayer, this must be uploaded along with it's contents (a Skins folder containing all the xaml/javascript etc..) to the root of your site. Any videos are then uploaded into your SilverlightPlayer folder before saving your post. If you want to check out what the other skins look like there are jpeg images in the SilverlightPlayer/Skins folder. Thats it!
One last note, if you haven't served silverlight content from your site before make sure you add the mime type for xaml, extension - .xaml, mime type - application/xaml+xml.
Enjoy a sample video here, curtesy of my partner who runs AlexZanDance.
(double click for full screen)
Update
Edited the code as per Troy Goode's suggestion in the comments to allow easy upload of files through the web interface. As Troy says below, all you need to do is go into the extension manager and change the Content Root to point to
App_Data/files, which is where DotNetBlogEngine puts files you've
uploaded through the web interface. Thanks Troy, like it!
SilverlightPlayer.zip (476.37 kb)