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
fix cc.sys.os && audio downloading on Alipay iOS #30
Conversation
function downloadAudio (item, callback) { | ||
if (cc.sys.__audioSupport.format.length === 0) { | ||
return new Error(debug.getError(4927)); |
There was a problem hiding this comment.
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({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里执行是在common里面loader之后?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接返回audio没事的吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没问题,最终只是取 audio.src
downloader 阶段只是在底层生成一份缓存
changeLog:
cc.sys.os
没定义的问题 (原因是 getSystemInfoSync() 接口返回的 platform 大小写不一致)