Silverlight 2.0 MEDIA PLAYER

By sunilmallya

Silverlight 2.0 has finally arrived and provides us with a cool option of coding in any language of our choice ( MANAGED CODE )..!! thank god.. javascript is really yucky !! but i know will end up using it quite sooner than later… itz like this yucky gum stuck on to your boot!

Comming to the real funda here abt Silverlight 2.0. After the Presentation @ Microsoft Student Partners South India BootCAMP .. Lotz of people requested me to blog about how to create a Silverlight Application .. more specifically creating a Simple video Library !. which indeed is simple ;) )

So tools i recommend you people to have are BLEND 2.5 March Preview , Visual Studio 2008 (Needed) and silverlight 2.0 runtime.

Start a new project in blend -> Choose Silverlight 2.0 Website

Now Lets add a media element by double clicking on the media we just added ! ( page.Xaml File )


Create 3 buttons name them Play / pause /Stop : try using in intellisense in VS 2008 !! :) –> Add click events to thsese buttons

 

Create a nice media holder back ground as shown ( better than Shoddy one i have done !!!)
 

Goto Page.xaml.cs file and add some logic to u’r newly create events
(check the code file to get more info ).
 

If you want to change video on some event ..add this code

(YourmediaelementName).Source = new Uri(”frisbee.wmv”, UriKind.Relative);
Just Remember here Source doesn’t take a string but takes a  URI instead !!

DOWNLOAD the code for the media player here !!!!

http://cid-7c189d3ffb9ce13c.skydrive.live.com/self.aspx/My%20Presentations/SLBootCampMediaPlayer_SunilMallya.zip

Tags: , , ,

One Response to “Silverlight 2.0 MEDIA PLAYER”

  1. Dhawal Says:

    Great Post.

    Thanx for posting…..

Leave a Reply