cc.AudioEngine.getInstance.setMusicVolume() have not work at safari in ios in version 2.2.2, but it is not in version 2.2

cc.AudioEngine.getInstance.setMusicVolume() have not work at safari in ios in version 2.2.2, but it is not in version 2.2
it is running right at chrome in pc. I did not test it at other browers

Hi, Timon

I’m not sure if it worked in version 2.2, but normally it shouldn’t, because apple doesn’t allow javascript to set audio volume… It can only be set with the physic volume buttons.

For more details, please check out this documentation: https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/Device-SpecificConsiderations/Device-SpecificConsiderations.html#//apple_ref/doc/uid/TP40009523-CH5-SW11

The chapter Volume Control in Javascript explained it:

Volume Control in JavaScript
>
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. \>

Huabin

Sorry, I made a mistake, after recheck the version 2.2, it is possible to control volume.
The volume of audio object doesn’t work in iOS, but WebAudio API should work correctly, that’s why it worked for 2.2.
We will check what is wrong in 2.2.2 and fix this issue.
You can watch this Issue if you like: http://cocos2d-x.org/issues/3819

Huabin

Hi, this issue has been fixed at: https://github.com/cocos2d/cocos2d-html5/pull/1510