The Directory.EnumerateFiles method will provide a list of files in a directory. It returns just a list of full filepath strings. I'd use that in a class constructor, pulling info like Name and Type out of the string, and do something like this:
// Controller action
public ActionResult GetVideos()
{
var videos = Directory.EnumerateFiles("Videos/");
var videoList = new List<Video>();
foreach (var video in videos)
{
videoList.Add(new Video(video));
}
return View(videoList);
}
// Razor view
@model IEnumerable<Video>
@foreach (var video in Model)
{
<video controls="controls" width="465" height="315">
<source src="@video.Source" type="@video.Type">
</video>
}
To prevent download, disable the context menu. The MDN Element: contextmenu event has the following to disable this, though I would use a class you've applied to all the video elements.
noContext = document.getElementById('noContextMenu');
noContext.addEventListener('contextmenu', e => {
e.preventDefault();
});