Feed Icon  

Contact

  • Bryant Likes
  • Send mail to the author(s) E-mail
  • twitter
  • View Bryant Likes's profile on LinkedIn
  • del.icio.us
Get Microsoft Silverlight
by clicking "Install Microsoft Silverlight" you accept the
Silverlight license agreement

Hosting By

Hot Topics

Tags

Open Source Projects

Archives

Ads

Silverlight Streaming Utility Classes

Posted in Silverlight at Wednesday, March 11, 2009 8:36 AM Pacific Standard Time

Yesterday I was working through another question in the Silverlight Forums about how to upload video to Silverlight Streaming via code. At first I tried to reference the Video.Show application, but there is a lot of code there and it doesn’t help if you just want to upload a bunch of videos to the same application. So I ended up taking some of the code from Video.Show and some of the code from the SDK/API and created a very simple Utility class to help with the process.

You can download the code on the Code Gallery site. It is very simple in that there is no error handling and I didn’t create a Silverlight version yet. I did implement GET, POST, PUT, MKCOL, and DELETE as well as creating the functionality to package a bunch of videos into a single zip which can be posted all at once.

A few examples from the code, first creating a directory and PUTting a file in it:

WebDavClient client = new WebDavClient("Your AppID", "Your Key"); 
// get those from http://silverlight.live.com
 
client.CreateFolder("MyVideos");
client.PutFile("MyVideos","C:\\videos\reallyCoolVideo.wmv");

Next, packaging up a bunch of videos and POSTing the zip as an application:

WebDavClient client = new WebDavClient("Your AppID", "Your Key"); 
// get those from http://silverlight.live.com
 
client.PackageAndPostFiles("MyVideos","C:\\videos\firstCoolVideo.wmv","C:\\videos\anothercoolVideo.wmv");

Let me know if you’d like to see a Silverlight version (be easy to implement) or if there are any other features you’d like added.

Enjoy!

Sunday, June 21, 2009 8:24:02 PM (Pacific Daylight Time, UTC-07:00)
Hello Bryan and thanks for the code. As you has asked, is it possible to have a silverlight version ? I am trying to do that and, it is hard for me :( !!
Big thanks for that !!
Albertos
Comments are closed.