Media Player: Local File Playback

Last post 04-13-2008 11:38 AM by Jet Blazer. 1 replies.

Sort Posts:

  • Media Player: Local File Playback

    04-13-2008, 6:37 AM
    • Loading...
    • Jet Blazer
    • Joined on 12-17-2007, 11:05 PM
    • Posts 2

    I am using the ASP.NET Futures Media control to stream video/audio. Everything works fine if I pass in a proper web url for playback.

    The media files are hidden in my server to prevent anonymous downloads. I have a download page that serve users the media files provided they are properly authenticated. The end point is, the media files are not publicly accessible. The files are stored outside the public web folders in my server's local file system.

    Unfortunately, this is also preventing me from passing in a url that the media player control can load. I understand the actual media player will load client side and its access is limited to whatever the client can view.

    Is there anyway to pass in a media stream to the control or just about any workaround/solution? I read a bit on asx streaming but from my quick reading, it looks like you need a media streaming daemon on the server, etc and I really don't want to go into all the trouble. Is there anyway I can write my own simple asx streamer?

    Any help (even the tiniest hint) is greatly appreciated!

  • Re: Media Player: Local File Playback

    04-13-2008, 11:38 AM
    • Loading...
    • Jet Blazer
    • Joined on 12-17-2007, 11:05 PM
    • Posts 2

    Fixed the problem.

    For those interested to know, I simply set the url to a regular aspx page and streamed the video from there. Something like this:

    protected void Page_Load(object sender, EventArgs e)

    { 

    if (CheckIfUserIsAuthorized())

    {

    FileInfo fi = new FileInfo(filePath);

    Response.Clear();

    Response.AddHeader("Content-Disposition", "attachment; filename=" + fi.Name);

    Response.AddHeader("Content-Length", fi.Length.ToString());Response.ContentType = "application/octet-stream";

    Response.WriteFile(fi.FullName);

    Response.End();

    }

    }

Page 1 of 1 (2 items)