Cracking the Silverlight Streaming Direct Content Access Code - Part II

5/3/2008 10:00:43 PM

So I am banging around on what I have started to call MyTube looking at different methods for accessing media stored in Silverlight Streaming. I got a question from someone that had read my original post that asked if there was anything I could do to help them out if they could not host *.ashx code on their web site but they still wanted to access SLS content and play it in their own customized browser.  I noodled on it a bit and figured that if all they needed was access to their own content, there really was nothing stopping me from letting them leverage the work I had done on my site via a redirect.  So I am happy to announce that you can now get access to your own Silverlight Streaming content by using this url:

http://www.slickthought.net/slickthoughttv/slsredirect.ashx?app=<your SLS Account ID>&app=<your SLS Application Name>&file=<content file name>

For example, if I wanted to get access to my Des Moines launch video from any site on the Internet, I would set the Source property on my Silverlight media element to:

As a matter of fact, you can click on that hyperlink and it will launch Windows Media Player for you!  The savvy among you may also realize that with a little work, it opens up another scenario for you as well - take a guess in the comments section and I will let you know if you are right.

DISCLAIMIER:  I do not make any guarantees as to the availability, reliability, accurateness, responsiveness or any other quality of service indicator for this application (slsredirect.ashx).  This application may be modified or removed at any time. It is for demonstration purposes only and should not be relied upon for anything other than a demonstration.

The code behind the SLSRedirect.ashx is shown below:

public void ProcessRequest (HttpContext context) {

        string account = context.Request.QueryString["account"];
        string app = context.Request.QueryString["app"];
        string file = context.Request.QueryString["file"];       
        string httpStream = string.Empty;

        if (account != null)
        {
            httpStream = SilverlightStreaming.GetMediaStream(account, app, file);
            context.Response.Redirect(httpStream);
        }
        else
        {
            context.Response.StatusCode = 400;
            context.Response.End();
        }
    }

What makes this even cooler is I can now publish my own Video Syndication Feed to let people see what is available and provide  them direct links to my media.  Click here to see a sample of my own feed and see how you can now click on the media links and immediately start playing content:

 

Those feeds are pretty much brute force implementations and not what I would have for a final feed format but it demonstrate how you can publish your videos to be shared and consumed by others in their own players.  If you want to have multiple videos per syndication item (something SLS would allow you to do), you pretty much have to go with an ATOM feed.  But most podcast readers seem to use RSS which only allows one enclosure per item.  If you want to use RSS, you will need to only upload one piece of media per SLS application or else the extra media will not show up in the RSS feed.

Tags: ,

SpaghettiCode

Comments are closed

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Jeff Brand Jeff Brand

This is the personal web site of Jeff Brand, self-proclaimed .NET Sex Symbol and All-Around Good guy. Content from my presentations, blog, and links to other useful .NET information can all be found here.

E-mail me Send mail


Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar

My Twitter Updates

XBOX
Live

Recent comments

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2010

Sign in