Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

video file download issue

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

The remote server is Windows Server 2008 + IIS 7.0 + IIS Media Bit Rate Throttling Control.

Since the request media URL can be discovered (e.g. from traffic sniffer), and I want to know how to prevent from download directly from the Url? i.e. I want end user to use my Silverlight media player application in browser to play the file, prevent them from download to local directly. Any easy and quick solution or reference code/documents?

like image 829
George2 Avatar asked Mar 04 '10 04:03

George2


People also ask

Why the video is not download?

Video downloads require a strong internet connection. Make sure that your device is connected to a 3mbps or faster Wi-Fi network, or a mobile network with a data plan that supports 3G, 4G, or LTE speeds. If you're not sure what your current internet speed is, you can test your speed online.

Why is my downloaded video not opening?

The file might not be compatible with your Android phone or the media player you are using. Chances are that the SD card where your video has been stored could be corrupted as well. If the video has been shot on your phone, then some changes in its settings or encoding could have made the video unsupported.


2 Answers

I might be clutching at straws here but what about using a HTTP handler to intercept requests to the media URL: When the HTTP handler encounters a request, it checks for a unique HTTP header in the request - this could be hard coded into your media player application so that the URL request is accompanied with the appropriate security header - and unless the HTTP header is present then all response is blocked. I know there are no code specifics here but it's an idea all the same.

like image 149
pb. Avatar answered Oct 24 '22 20:10

pb.


  1. Use the ASP.NET Authentication Service to authenticate/authorize your user
  2. Put the video in a folder where the web.config prevents un-authenticated access to the contents

If I'm not mistaken (and to be truthful, there is a chance as I've never tried this particular scenario) ... that will protect your video content, while allowing the authorized user to access it via silverlight.

like image 31
Joel Martinez Avatar answered Oct 24 '22 19:10

Joel Martinez