Open HaYesSeattle opened 8 years ago
@cKellyDesign - do you think this is the issue? seems odd that it loads images but not sound. http://community.phonegap.com/nitobi/topics/media-plugin-in-phonegap-build
here is another android specific issue: http://stackoverflow.com/questions/27901757/playing-wav-file-in-phonegap http://stackoverflow.com/questions/12657341/phonegap-not-able-to-play-local-sound-file
https://chrisgriffith.wordpress.com/2014/04/01/edge-animate-phonegap-build/
http://stackoverflow.com/questions/21968455/cordova-media-capture-android-error-no-3-issue
Solution for iphone was to add: < plugin name="org.apache.cordova.media" />
oy @cKellyDesign - I think I found the solution... we need to use the media plugin: http://stackoverflow.com/questions/21638741/html5-audio-not-playing-in-phonegap-app-possible-to-use-media
but I tried just that and it wasnt working.
It might have to be on click? because there are other issues with old browsers...Audio Streams will Not Load in Mobile Browsers
When the webpage loads, mobile browsers (Safari/Chrome in iOS 6 and below and Chrome in Android – jelly bean) do not download the audio streams, unless the user initiates an action like onclick or ontouchstart. They simply keep the audio files pending (checked in dev tools network tab in android).
Hence, this piece of code would do nothing on the aforementioned mobile browsers (will be just silent) while play fine on desktop browsers:
var audio = document.querySelector('audio#game_music'); audio.play(); Features like preload and autoplay (as attributes in the audio tag) don’t work either. Sad.
and then there is this: http://codetheory.in/solve-your-game-audio-problems-on-ios-and-android-with-web-audio-api/
all
android
iphone