Problem downloading video file

I am using VSTS 2008 + C # + .Net 3.5 + Silverlight 3.0 + ASP.Net to develop a Silverlight application (video player) in a browser, and the function is simple, just use MediaElement to play the remote video file.

The remote server is data rate throttling control in Windows Server 2008 + IIS 7.0 + IIS.

Since the request request URL can be detected (e.g. traffic sniffer), and I want to know how to prevent the download directly from the URL? those. I want the end user to use my Silverlight media player application in the browser to play the file so that it cannot be directly downloaded to the local one. Any quick and easy solution or link code / documents?

+7
c # visual-studio-2008 silverlight
source share
5 answers

I could compress the straw here, but what about using an HTTP handler to intercept requests on the media URL: when the HTTP handler encounters the request, it checks the unique HTTP header in the request - this can be hardcoded into your media player application so that the URL - the request was accompanied by an appropriate security header - and if the HTTP header is not present, the entire response is blocked. I know that there is no specificity of the code, but this is an idea after all.

+1
source share
  • Use ASP.NET authentication service to authenticate / authorize your user.
  • Put the video in the folder where web.config prevents manual access to the content

If I’m not mistaken (and to be true, there is a chance, since I have never tried this particular scenario) ... which will protect your video content by allowing an authorized user to access it through silverlight.

+1
source share

What Joel suggested above may make sense. Especially if the Silverlight web application was running in an application pool that started under a specific identifier (ie, "SvcMyVideoApp"). Then you can do this where only this identity can access the content folder. Set all other content requests to ban (except maybe your own :))

0
source share

If I am not mistaken ... if configured correctly, IIS 7 multimedia services should not even serve raw files, then it should serve as an raw raw aspx page.

I played with this a few months ago, but when I installed the Media plug-in for IIS 7, it did not serve as raw media files, and I could only access them through the silverlight interface. I used Expression Studio to create my Silverlight view page and encoded it for "smooth streaming."

0
source share

An easy way would be to add a handler to catch the request, e.g. @pb. I do not know if headers are sent correctly or not. A simple way would be to simply check if the request has a referrer ..

String.IsNullOrEmpty (context.Request.ServerVariables ["HTTP_REFERER"])

or you will need authentication and send an auth cookie with the request.

0
source share

All Articles