html5 - HTML 5 audio tag issues (no sound) with phonegap on android 4.x -


platform: android version 4.x

issue: html 5 audio tag

compiled: framework phonegap

i have been trying play simple sound html 5, cant work.

i read there general "not supporting" thing going on android, understand it, version 4.x supports html 5 audio tag.

config.xml did enable of features in eg. file access, device access , so, tried include features. let u guys know.

html working atm, figured maybe should go directly try , sound out, make costum controls jq.

<audio controls="true">     <source src="media/sound.mp3" type="audio/mpeg">     <source src="media/sound.ogg"  type="audio/ogg">     <source src="media/sound.wav"  type="audio/wav">     browser not support html5 audio. </audio>   

conclusion far havent hear sounds, tried trigger different ways like:

var newsound = new audio("sound.ogg"); newsound.play();     

any idea or suggestion welcome.

thanks in advance :-)

you need piece of javascript working. try following:

<audio id="a" controls="true">...  var audio = document.getelementbyid('a'); audio.addeventlistener('touchstart', function() { audio.play(); }, false); 

when user touches audio element sound should play.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -