Hello I am trying to make a new volume bar for my sound, however it's not working, i googled upon this, and tried to put it togheter again but the first code is missing at the moment so I dont know how to acheive this. I did something like this but my sound is not autoplaying and i cannot change the volume on the sound. and if i writes controls autoplay the whole bar shows up which i dont want.
<input type= "range" class = "slider" id = "slider" value = "0" maxlength ="100">
<audio id ="audio-player" src = "test.mp3"></audio>
$( document ).ready(function() {
$("#slider").slider({
value : 75,
step : 1,
range : 'min',
min : 0,
max : 100,
slide : function(){
var value = $("#slider").slider("value");
document.getElementById("audio-player").volume = (value / 100);
}
});
});