4

I am trying to make a page with optional background music - the html5 tag is exactly what I want for the purpose. Only trouble is that it opens up at 100% volume. I have links on the page to music files/vids that the user will want to have their volume up for, so it would be better for the bkg music to open up (as a default setting) of say 0.5 (50%).

Is there a simple attribute that can be assigned to the tag to achieve this? my code:

(please note - I'm not talking about adjusting the volume after the file is opened - it's just fine as is. I'm asking about the default setting...) Thanks

chris_c
  • 61
  • 1
  • 5
  • Possible dup http://stackoverflow.com/questions/10075909/how-to-set-the-loudness-of-html5-audio – megawac Nov 17 '13 at 05:17

1 Answers1

5

You can write a small javascript code.

From w3schools, http://www.w3schools.com/tags/av_prop_volume.asp:

<script type="javascript">
myVid=document.getElementById("video1");
myVid.volume=0.2;
</script>