locked
i saved mp4 video files in ~/videos folder of webmatrix3 webpages site.now want to access. RRS feed

  • Question

  • 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.


    Friday, April 1, 2016 2:03 PM

Answers

  • User1493762548 posted

    there was problem with the fileName i changed the code belonging to db quiry regarding filename .the problem solved . special thanks to mikedotnetting help.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, April 1, 2016 4:41 PM