Skip to content

Commit

Permalink
ensure load differed-loaded audio (cocos#3077)
Browse files Browse the repository at this point in the history
sdfsdf
  • Loading branch information
PPpro authored and pandamicro committed Aug 13, 2018
1 parent 18feb11 commit 521b429
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cocos2d/audio/CCAudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,20 @@ Audio.State = {
self._onLoaded();
}
});
cc.loader.load({
url: clip.nativeUrl,
// For audio, we should skip loader otherwise it will load a new audioClip.
skips: ['Loader'],
},
function (err, audioNativeAsset) {
if (err) {
cc.error(err);
return;
}
if (!clip.loaded) {
clip._nativeAsset = audioNativeAsset;
}
});
}
}
else {
Expand Down

0 comments on commit 521b429

Please sign in to comment.