javascript - How to change the Volume of an audio object with html range slider? -
hi code i'm using play shoutcast cast stream works fine not able change volume wrong i'm new @ this.
<script> function audioobject() { var link = new audio('http://107.155.72.250:8000/;.mp3'); return link; } function startradio() { audioobject().play(); } function changevolume(amount) { audioobject().setvolume(amount); } </script> <input type="button" id="play" value="play" onclick="startradio()"/> <input type="range" id="vol" max="1" min="0" step="0.01" onchange="changevolume(this.value)"/>
the correct method set volume audioobject.volume = value
here's demo showing similar setup want.
Comments
Post a Comment