I have a mvc4 application serving my HTML 5 code to the client. I am using the HTML 5 video tag to show a video. Usually I would put the video file into my application root directory to access it, but now I want to implement another scenario. My root directory for my app is i.e. C:\MyApp
while the video file is in the directory C:\VideoDir
.
Now I want to use the video tag and pass it an url as source that looks like
http://myurl/MyApp/Media/Video/test.mp4
I need to find a way to redirect this URL to the actual videofile inside of the VideoDir without expose the VideoDir via http
to the public. The reason for this approach is, that I want to check permissions before serving the video. If I would expose the VideoDir to public via http
, anyone who knows the baseurl would be able to watch any video s/he wants to.
I tested a bit with FileContentResult
, FilePathResult
and FileStreamResult
. Chrome can handle the result, but it is not possible to seek and even worst the video tag of iOS's Safari cannot consume these results, while it could consume the original .mp4 file.
Any idea or suggestions?