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 audioEngine deprecated code for fireball/issues/6058 #1817

Merged
merged 1 commit into from Jul 19, 2017

Conversation

knoxHuang
Copy link
Contributor

Re: cocos-creator/fireball#6058

Changes proposed in this pull request:

  • 这里是由于 audioEngine deprecated 中的 playEffect 参数传入的 loop 为 undefined, 导致 C++ 变量类型转换出错

@cocos-creator/engine-admins

@@ -104,7 +104,7 @@ exports.deprecated = function (audioEngine) {
// cc.warn(INFO, 'audioEngine.playEffect', 'audioEngine.play');

return function (url, loop, volume) {
return audioEngine.play(url, loop, volume === undefined ? effectsVolume : volume);
return audioEngine.play(url, loop || false, volume || effectsVolume);
Copy link
Contributor

@jareguo jareguo Jul 18, 2017

Choose a reason for hiding this comment

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

如果 volume === 0 会怎样?

@jareguo
Copy link
Contributor

jareguo commented Jul 19, 2017

我看了下,CCAudioEngine.js 中,本来就有对参数进行校验和转换了。你这里的应该是 jsb polyfill 里面要实现的逻辑,而不是 deprecated 要实现的。

@knoxHuang
Copy link
Contributor Author

jsb-audio 里面会去调用 deprecated 里面的函数,所以还是在 deprecated 做才行

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