Skip to content

Commit 1c8ec50

Browse files
YShumovYShumov
YShumov
authored and
YShumov
committed
Merge pull request #1 from VisualSJ/develop-2878PR
To prevent the events are covered
2 parents b158fdc + 7282584 commit 1c8ec50

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

cocos2d/audio/CCAudio.js

+4-8
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,10 @@ cc.Audio = cc.Class.extend({
315315
if(self._ignoreEnded){
316316
self._ignoreEnded = false;
317317
}else{
318-
self._playing = false;
318+
if(!self._pause)
319+
self.stop();
320+
else
321+
self._playing = false;
319322
}
320323
};
321324
},
@@ -671,13 +674,6 @@ cc.Audio = cc.Class.extend({
671674
}
672675
audio.play(0, loop);
673676
audio.setVolume(this._musicVolume);
674-
function cbEnd(){
675-
if (!this._currMusic._pause) {
676-
this.stopMusic();
677-
}
678-
}
679-
var cbEndWithContext = cbEnd.bind(this);
680-
audio._currentSource.onended = cbEndWithContext;
681677

682678
this._currMusic = audio;
683679
},

0 commit comments

Comments
 (0)