Merge pull request #2451 from umbrellaPP/v1.9

fix wechatGame bgm can't stop
This commit is contained in:
Jare Guo
2018-03-19 10:49:27 +08:00
committed by GitHub
+11 -3
View File
@@ -199,9 +199,17 @@ Audio.State = {
proto.stop = function () {
if (!this._element) return;
try {
this._element.currentTime = 0;
} catch (error) {}
if (CC_WECHATGAME) {
setTimeout(function () {
try {
this._element.currentTime = 0;
} catch (error) {}
}.bind(this), 0);
} else {
try {
this._element.currentTime = 0;
} catch (error) {}
}
this._element.pause();
// remove touchPlayList
for (var i=0; i<touchPlayList.length; i++) {