volume off does not work in html5 video ipad 2.
player = document.getElementById(element_id);
if (player.muted){
player.muted = false;
player.volume = 1;
//player.volume(1);
}else{
player.muted = true;
player.volume = 0;
//player.volume(0);
}
I'm afraid iOS does not allow changing the volume with Javascript. From Apple's documentation (emphasis is mine):
On the desktop, you can set and read the volume property of an or element. This allows you to set the element’s audio volume relative to the computer’s current volume setting. A value of 1 plays sound at the normal level. A value of 0 silences the audio. Values between 0 and 1 attenuate the audio.
This volume adjustment can be useful, because it allows the user to mute a game, for example, while still listening to music on the computer.
On iOS devices, the audio level is always under the user’s physical control. The volume property is not settable in JavaScript. Reading the volume property always returns 1.
There is no mention of the muted
property, but experimenting shows that it can't be changed either:
http://jsbin.com/anikab/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With