cocos2d / cocos2d-js

cocos2d-x for JS
http://www.cocos2d-x.org
MIT License
1.86k stars 490 forks source link

CCAudio.js 502 line webkitAudioContext not found createGain #1628

Open tmkook opened 9 years ago

tmkook commented 9 years ago

device: ipod iOS 6.1.6 safari

pandamicro commented 9 years ago

@VisualSJ Please take a look

VisualSJ commented 9 years ago

@pandamicro This problem has been fixed.

https://github.com/cocos2d/cocos2d-html5/commit/038d25b729dfddd8292753da511d88fbe7272af4

tmkook commented 9 years ago

@VisualSJ This problem is not appear in the 360browser, in iOS6.1.6 version of safari when loading the mp3 webkitAudioContext lack createGain method without exception handling can lead to crashes.

http://m14.yyport.com/error.jpg

http://m14.yyport.com/error2.jpg

cocos2d version: cocos2d-js-3.2

Upgrade to 3.3 problem remains

pandamicro commented 9 years ago

@tmkook Can you try the patch in https://github.com/cocos2d/cocos2d-html5/commit/038d25b729dfddd8292753da511d88fbe7272af4 to see the result ? It should be able to fix your issue

VisualSJ commented 9 years ago

@tmkook The PR is repair “createGain” does not exist. If manager create audio error, will automatically switch to domAudio~

tmkook commented 9 years ago

@VisualSJ 你好,增加了异常处理崩溃的问题已解决但是似乎不够完美,一个场景只能播放一个声音并且还有延迟,比如点击一个按钮时场景都已经切换好了才开始播放点击的音效。是设备版本太低吗?这个问题目前只有iOS6的设备中才会出现。

tmkook commented 9 years ago

@VisualSJ https://developer.apple.com/library/safari/documentation/AudioVideo/Conceptual/Using_HTML5_Audio_Video/PlayingandSynthesizingSounds/PlayingandSynthesizingSounds.html

你好,我用这里的方法可以完美解决,希望cocos能早点兼容ios6