I know volume control of an audio tag isn't possible on iOS but I want to bypass that by using Web audio API and modify the value of the gain node. The code is working on desktop but not on iOS, can you see the problem ?
var soundx = document.getElementById("sound");
var audiocontext = window.AudioContext || window.webkitAudioContext;
var context = new audiocontext;
var source1 = context.createMediaElementSource(soundx);
var gain1 = context.createGain();
soundx.get(0).play();
gain1.connect(context.destination);
source1.connect(gain1);
gain2.gain.value=0.5;
gain1.gain.value=0.5;