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
merged 2 commits into from Nov 15, 2019

Conversation

PPpro
Copy link
Collaborator

@PPpro PPpro commented Nov 14, 2019

changeLog:

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

20191114170924

@PPpro PPpro 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));
Copy link
Contributor

@holycanvas holycanvas Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里用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({
Copy link
Contributor

@holycanvas holycanvas Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Collaborator Author

@PPpro PPpro Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

对,会覆盖 common 的逻辑

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

@holycanvas holycanvas Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接返回audio没事的吧?

Copy link
Collaborator Author

@PPpro PPpro Nov 15, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没问题,最终只是取 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants