<!DOCTYPE html>
<html>
<body>

<p>This example uses the HTML DOM to assign an "onvolumechange" event to a video element.</p>

<p>Try to change the volume in the bottom right corner.</p>

<video controls id="myVideo">
  <source src="mov_bbb.mp4" type="video/mp4">
  <source src="mov_bbb.ogg" type="video/ogg">
  Your browser does not support HTML5 video.
</video>

<p>Video courtesy of <a href="../../www.bigbuckbunny.org/index.html" target="_blank">Big Buck Bunny</a>.</p>

<script>
document.getElementById("myVideo").onvolumechange = function() {myFunction()};

function myFunction() {
    alert("The volume has been changed!");
}
</script>

</body>
</html>