I'm having some trouble testing a website on an iOS mobile (both safari and chrome).
I have an HTML5 audio, a play button and a range input for the volume. The script works great on desktop (all browsers), however, on my iPad/iPhone, I can move the slider's knob, but the volume doesn't change. What could it be? I've searched all around for the answer.
HTML:
<a href="javascript:void(0);" onclick="play();">PLAY</a>
<input id="volumeslider" type="range" min="0" max="100" value="100" step="1">
JS:
var mySound = new Audio();
var src1 = document.createElement("source");
src1.src = "mysound-file.mp3";
mySound.appendChild(src1);
function play() { mySound.play(); }
document.getElementById("volumeslider").addEventListener("input", function() {
changeVolume();
}, false);
function changeVolume() {
mySound.volume = volumeslider.value / 100;
}
I have tested this exact code (except for the audio file URL) and again, it works on desktop and not on mobile. Any ideas?