User1493762548 posted
i am new to asp.net webmatrix3 using webpages. i am building a video website.i saved mp4 videos in ~/videos folder now want to access them i copied html5video.cshtml from gis.github site and saved in @Html5Videos.cshtml in App_code folder .
**Note:the names of files in videos folder are saved with mp4 extension.**
In display.cshtml the code is as follows:
@{
Page.Title="Display";
var ProductId = Request["Id"];
// var ProductId = UrlData[0].AsInt();
var db = Database.Open("PhotoGallery");
var FileName = db.QuerySingle("SELECT FileName FROM ProductVideos WHERE ProductId = @0", ProductId);
if (FileName == null)
{
Response.SetStatus(HttpStatusCode.NotFound);
return;
}
}
<!DOCTYPE html>
<html>
<head>
<title>Product Video</title>
</head>
<body>
@Html5Video.Create(mp4Url:"~/Videos/FileName",width:320,height:240)
</body>
</html>
i am thankful in advance for help to play video.