You must Sign In to post a response.
  • Category: ASP.NET

    How to use HTML5 video control from ASP.Net code behind?

    Hello,

    I have the following code with .aspx page.

    Code:-

    <video id="VideoPlayer" src="<%=ResolveUrl("~/Videos/Butterfly.mp4") %>" controls="true"
    width="400" height="350" loop="true" runat="server"/>

    Please let me know how to set its video url from code behind of the vb.net.


    Thanks.
  • #770396
    try to add source control inside of video control and get the path from code behind like below

    <video autoplay="autoplay" id="video1" style="margin-top:-10px;" width="350" height="220" controls="controls">
    <source id="mp4video" src='<%= getvideo() %>' type="video/mp4" />
    </video>
    public string getvideo()
    {
    return "media/video1.mp4";
    }

    Thanks!
    B.Ramana Reddy


  • Sign In to post your comments