mariogarranz Posted October 14, 2014 Share Posted October 14, 2014 I have noticed that my games created with Phaser are crashing in Galaxy S4 stock browser. They work just fine in any other browsers, even in other Android devices stock browser. I don't have a Galaxy S4 myself to do the tests so I asked someone else to do these for me. We couldn't manage to get a JavaScript console shown in this browser (USB debugging doesn't seem to work, about:debug doesn't work either). After that we did some tests and noticed that when the sounds of the game are disabled, it works!In my games I use Phaser to detect WebAudio support. If the browser has WebAudio support, I will use both sounds and music. If it doesn't, I would just use a music track on the background. It seems that this stock browser does support WebAudio, because we get sounds, but somehow it makes the game crash. Disabling sound but not music works as well. Has anyone else experienced something like this?I'm using Phaser 2.0.4 in these games. PS: We have reasons to believe this may as well be happening with Galaxy S3, but we couldn't test it yet. Link to comment Share on other sites More sharing options...
alex_h Posted October 14, 2014 Share Posted October 14, 2014 The samsung stock browser does not support web audio. Perhaps if you are incorrectly detecting that web audio is supported and trying to utilise it when it is unavailable then this could be what is crashing your game? Or trying to play sounds that haven't loaded because elsewhere Phaser correctly detected that web audio was not supported and did not load them? Link to comment Share on other sites More sharing options...
mariogarranz Posted October 14, 2014 Author Share Posted October 14, 2014 Hey alex, thanks for your help.Well, if device.webAudio is false, I will just load different musics as a single audioSprite and play that. Even the enable sound button is greyed out in this case. That's not happening, so I'm pretty positive that Phaser is detecting WebAudio as available for this device.I make some of my Android tests on a Galaxy Tab 3 10.1. The stock browser there works just as intended, it does not have WebAudio, so it just enables music.I checked Phaser WebAudio detection, and it's as simple as this:this.webAudio = !!(window['webkitAudioContext'] || window['AudioContext']);So, maybe this is failing somehow? Knowing Android stock browser, specially Samsung versions, it would not be surprising that it is a browser problem anyway. If someone knows something else about this it would really help! Link to comment Share on other sites More sharing options...
mariogarranz Posted October 14, 2014 Author Share Posted October 14, 2014 OK just a quick note after making some tests, Phaser.Device.webAudio is returning true for the Galaxy S4 stock broswer.Are you sure it does not support WebAudio? If so, Phaser is detecting it wrong.My guess is it does support WebAudio, but maybe it's not properly implemented. Link to comment Share on other sites More sharing options...
alex_h Posted October 14, 2014 Share Posted October 14, 2014 Sorry I could be wrong, I haven't specifically tested on the S4. I have an S3 though and to my knowledge the stock browser has not been updated since to add WebAudio support. But I'd welcome hearing from anybody else on this question. Link to comment Share on other sites More sharing options...
alex Posted October 15, 2014 Share Posted October 15, 2014 Hi, yes the stock browser with very new android versions can play webaudio (because that stock browser is more or less a older chrome version I think...).But there are some devices + android versions - maybe like your s4 - that tell you that they can play webaudio, but it doesn't really work (no sound, crashes,... ). So I think you have to exclude such devices manually and force the audio tag. Alex Link to comment Share on other sites More sharing options...
mariogarranz Posted October 15, 2014 Author Share Posted October 15, 2014 Hey, thanks Alex (both of you )That's what I expected, a crappy implementation of the WebAudio API causing all of these troubles. I will just use Phaser.Device.isAndroidStockBrowser() and disable WebAudio for these.Thanks again! Link to comment Share on other sites More sharing options...
alex_h Posted October 15, 2014 Share Posted October 15, 2014 Jeez Samsung have a lot to answer for! Link to comment Share on other sites More sharing options...
lmfname_Marco Posted September 6, 2015 Share Posted September 6, 2015 how to solve this problem?? Link to comment Share on other sites More sharing options...
Recommended Posts