iphone - Don't play HTML5 audio when vibrate switch is on -
i've writing little web app target iphone initially. 1 of it's functions play audio file when icon clicked. following code:
$('#quicksample').click( function() { $('#thesound').get(0).play(); });
then relevant html is:
<audio id="thesound" src="demo.mp3"></audio> <div class="icon"> <a href="" id="quicksample" title="quick sample"> <i class="icon-volume-up icon-2x"></i> </a> </div>
the problem i'm having plays audio file when iphone switched silent or vibrate mode. want nice , not play sound when phone in vibrate mode. can test vibrate mode , skip playing if it's on? there better way? expected default behavior.
Comments
Post a Comment