Skip to content

Commit b1c372b

Browse files
committed
Merge pull request #1510 from pandamicro/develop
Fixed #3819: Use WebAudio on iOS
2 parents 62b25d0 + 092ec26 commit b1c372b

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

cocos2d/audio/SimpleAudioEngine.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,8 @@ cc.WebAudioEngine = cc.AudioEngine.extend(/** @lends cc.WebAudioEngine# */{
14141414
* @private
14151415
*/
14161416
_endSound: function(sfxCache) {
1417+
if (sfxCache.sourceNode.playbackState && sfxCache.sourceNode.playbackState == 3)
1418+
return;
14171419
if (sfxCache.sourceNode.stop) {
14181420
sfxCache.sourceNode.stop(0);
14191421
} else {
@@ -1837,7 +1839,7 @@ cc.AudioEngine.isMusicPlaying = false;
18371839
cc.AudioEngine.getInstance = function () {
18381840
if (!this._instance) {
18391841
var ua = navigator.userAgent;
1840-
if (cc.Browser.supportWebAudio && !(/iPhone OS/.test(ua)||/iPad/.test(ua))) {
1842+
if (cc.Browser.supportWebAudio) {
18411843
this._instance = new cc.WebAudioEngine();
18421844
} else {
18431845
if(cc.Browser.isMobile) // TODO construct a supported list for mobile browser

0 commit comments

Comments
 (0)