0

As usual, after I have struggled for a day, I reach out for help.

What I want to achieve is have my own controls for an HTML video tag. I use ASP page controls and I want to add an on-click event. Button clicks for: volume up, volume down, replay video. The code that I am trying is as follows:

<body>
<form runat="server">
<div>

<table>
<tr>
          <td>
      <video>
        <source src="movie.mp4" type="video/mp4">
                    Your browser does not support the video tag.
       </video>
     </td>
    </tr>
    <tr>
         <td><asp:Button id ="myButtonNext" runat="server" Text="Volume up" cssClass="button" OnClick="myAudioUp"/></td>
    </tr>
</table>

<script>
    function myAudioUp()  
    {
        var myVideo = document.getElementById("myVideo");
        var myVolume = MyVideo.volume
        MyVideo.volume = myVolume + 0.1;
    }
</script>

</div>
</form>
</body>

I use VB.NET a lot. But js is not my strong point. Any help will be appreciated.

1 Answers1

0

incorrect variable not MyVideo.volume but myVideo.volume

var myVideo = document.getElementById("myVideo");
var myVolume = myVideo.volume
myVideo.volume = myVolume + 0.1;
Fakt309
  • 821
  • 5
  • 14