How to stream a movie in ASP.NET?

Discussion in 'Microsoft Development' started by liming, Apr 25, 2007.

  1. liming

    liming Perch

    Hey all,

    I'm looking for a solution similar to how youtube and googel video does.. you load a .wmv or .swf, it "Streams" the movie back to the client instead of waiting for the whoel movie to donwload.

    For us, I'm thinking of providing flash demostration to our customers, but some of the files can be quite big, I don't want ppl to wait for the whole movie to be "cached" before they can start watching... so I'm not sure I want to do that unless I figure out how to "stream" the movies.

    Here is an article talks about how to do that in asp.net 2.0

    FLV Flash video streaming with ASP.NET 2.0, IIS and HTTP handler

    but that requires configuration of IIS which obviously we can't do. Anybody else done something like that?

    Thanks
  2. antic

    antic Perch

    I think you can.. try setting up a 404 page in HSphere, and make it an ASPX page. This means .NET will capture your 404 errors. In your 404 page, check for the .wmv or .swf extension, and if the file exists on the site, process accordingly. Otherwise serve up a normal 404 error response.

    That should work, without having to change anything in IIS to handle those files.
  3. liming

    liming Perch

    Antic, that's an approach i never thought about!! but let me get this clear, are you saying I should do what the httpandler in that article does? How do I link to my .swf file then? In the article it's
    linking to the .swf directly

    <param name="movie" value="scrubber.swf?file=http://&bufferTime=3&autoStart=false" />

    so i should instead link to the 404page?

    <param name="movie" value="404page.aspx?filename=scrubber.swf?file=http://&bufferTime=3&autoStart=false" />
  4. antic

    antic Perch

    Good question, but I suspect you still link it to the .swf file, as that is what will be in the http request I believe. This is new territory, so test it both ways, have a fiddle and see what happens. :)
  5. tetranz

    tetranz Perch

    I haven't tried it myself but I think Jodo's servers are setup to support http streaming. As I understand it, this means that you can simply place a Windows Media or Real Media file on the web server and clients will stream (rather than download) it if they are a reasonably modern version.

    I think the main limitation of this compared to having a proper streaming server is that you can only support a very limited number of simultaneous streams. That might not be an issue for something that is unlikely to have more than one or two watching at the same time.

    Ross

Share This Page

JodoHost - 26,000 hosting end-users in 100 countries
Plesk Web Hosting
VPS Hosting
H-Sphere Web Hosting
Other Services