From 8880e8e7da2573a71f30dcca84d7bc04bab1f04b Mon Sep 17 00:00:00 2001 From: VisualSJ Date: Tue, 27 Feb 2018 10:08:01 +0800 Subject: [PATCH] Interrupt callback when _src changes. --- cocos2d/audio/CCAudio.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js index 694f83e101..93dc5ffb5d 100644 --- a/cocos2d/audio/CCAudio.js +++ b/cocos2d/audio/CCAudio.js @@ -114,7 +114,7 @@ Audio.State = { // If the resource does not exist if (!item || !item.complete) { return cc.loader.load(src, function (error) { - if (!error) { + if (!error && src === audio._src) { var item = cc.loader.getItem(src); audio.mount(item.element || item.buffer); audio.emit('load');