From fbaf432017fa2cde9d028afae8281b39f913d29b Mon Sep 17 00:00:00 2001 From: PP Date: Tue, 8 May 2018 10:23:19 +0800 Subject: [PATCH] remove setTimeout when stop audio (#2639) --- cocos2d/audio/CCAudio.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/cocos2d/audio/CCAudio.js b/cocos2d/audio/CCAudio.js index 70e20bc8c6..d8d91aa9ef 100644 --- a/cocos2d/audio/CCAudio.js +++ b/cocos2d/audio/CCAudio.js @@ -204,17 +204,9 @@ Audio.State = { proto.stop = function () { if (!this._element) return; - if (CC_WECHATGAME) { - setTimeout(function () { - try { - this._element.currentTime = 0; - } catch (error) {} - }.bind(this), 0); - } else { - try { - this._element.currentTime = 0; - } catch (error) {} - } + try { + this._element.currentTime = 0; + } catch (error) {} this._element.pause(); // remove touchPlayList for (var i=0; i