0

I`m using the music player html5 jquery music player for my website.But I found that there is no option to control the volume for the music player.Could any one please help me to include an external volume control for the html5 jquery music player.

Here you can find the demo for html5 jquery music player

http://www.codebasehero.com/files/music-player-1.0.1/demo/

rms
  • 57
  • 1
  • 4
  • 7
  • 1
    The solution to this can be found in [this question](http://stackoverflow.com/questions/9589292/using-jquery-to-control-html5-audio-volume) – SlashmanX Nov 28 '12 at 10:27

1 Answers1

1

Using jQuery, you can create a function in your script tag like the following...

var audio = document.getElementById("player");
$('.volume-up').click(function() {
    audio.volume+=0.1;
    return false;
});
$('.volume-down').click(function() {
    audio.volume-=0.1;
    return false;
});

now you can create two anchor tags <a> with the above classes like so...

<a class="volume-up" href="#">Turn it up!</a>
<a class="volume-down" href="#">Turn it down!</a>
Joel Biffin
  • 348
  • 1
  • 6
  • 18
  • Since you're using jquery, you can also do this to get the audio object: var audio = $("#player").get(0); – kbriggs Feb 01 '13 at 02:12