Im running a player with howler.js and trying to connect a volume slider that i can't get to work. Any help appreciated
This is what i have
<script>
function createHowl() {
var number = Math.floor((Math.random() * 14) + 1);
return new Howl({
src: ['audio/' + number + '.wav'],
autoplay: false,
loop: false,
volume: 1.0,
onend: function() {createHowl().play()}
});
}
createHowl().play();
</script>
<input type="range" min="0" max="1" value="0" step="0.1" onchange="showValue(this.value)" />
<span id="range">0</span>
<script type="text/javascript">
function showValue(newValue)
{
document.getElementById("range").innerHTML=newValue;
createHowl.volume(newValue);
}
</script>
Thanks