Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix cc.sys.os && audio downloading on Alipay iOS #30

Merged

Conversation

@umbrellaPP
Copy link
Collaborator

umbrellaPP commented Nov 14, 2019

changeLog:

  • 修复部分小游戏平台 cc.sys.os 没定义的问题 (原因是 getSystemInfoSync() 接口返回的 platform 大小写不一致)
  • 修复支付宝 iOS 上的音频加载一直走 error 回调的问题, (支付宝音频实例复用事件导致,他们将在下个版本修复,不过 2.2 需要做下容错)

20191114170924

@umbrellaPP umbrellaPP requested a review from holycanvas Nov 14, 2019
function downloadAudio (item, callback) {
if (cc.sys.__audioSupport.format.length === 0) {
return new Error(debug.getError(4927));

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 15, 2019

Contributor

这里用debug会出错,用cc.debug吧

// FIX audio downlaod error on Alipay iOS 10.1.78
if (cc.sys.os === cc.sys.OS_IOS) {
cc.loader.downloader.addHandlers({

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 15, 2019

Contributor

这里执行是在common里面loader之后?

This comment has been minimized.

Copy link
@umbrellaPP

umbrellaPP Nov 15, 2019

Author Collaborator

对,会覆盖 common 的逻辑

callback(new Error('load audio failed ' + item.url), null);
});
audio.src = item.url;

This comment has been minimized.

Copy link
@holycanvas

holycanvas Nov 15, 2019

Contributor

直接返回audio没事的吧?

This comment has been minimized.

Copy link
@umbrellaPP

umbrellaPP Nov 15, 2019

Author Collaborator

没问题,最终只是取 audio.src
downloader 阶段只是在底层生成一份缓存

@holycanvas holycanvas merged commit 8526abc into cocos-creator-packages:v2.2.1-release Nov 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.