mirror of
https://github.com/smallmain/cocos-enhance-kit.git
synced 2025-10-09 22:35:23 +00:00
[engine] [cocos2d-x] [jsb-adapter] 适配引擎 v2.4.12 版本
This commit is contained in:
@@ -316,7 +316,6 @@ Audio.State = {
|
||||
}
|
||||
this._state = Audio.State.INITIALZING;
|
||||
}
|
||||
return clip;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
@@ -493,7 +492,7 @@ let WebAudioElement = function (buffer, audio) {
|
||||
if (this._currentSource)
|
||||
this._currentSource.loop = bool;
|
||||
|
||||
return this._loop = bool;
|
||||
this._loop = bool;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
@@ -549,7 +548,6 @@ let WebAudioElement = function (buffer, audio) {
|
||||
} else {
|
||||
this.playedLength = num;
|
||||
}
|
||||
return num;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
|
@@ -43,6 +43,9 @@ let recycleAudio = function (audio) {
|
||||
audio.off('ended');
|
||||
audio.off('stop');
|
||||
audio.src = null;
|
||||
if (cc.sys.platform === cc.sys.ALIPAY_GAME) {
|
||||
audio.destroy();
|
||||
} else {
|
||||
// In case repeatly recycle audio
|
||||
if (!_audioPool.includes(audio)) {
|
||||
if (_audioPool.length < audioEngine._maxPoolSize) {
|
||||
@@ -50,6 +53,7 @@ let recycleAudio = function (audio) {
|
||||
}
|
||||
else {
|
||||
audio.destroy();
|
||||
}
|
||||
}
|
||||
}
|
||||
audio._shouldRecycleOnEnded = false;
|
||||
|
Reference in New Issue
Block a user