Hey Guys,
How doi get sound to play on a mobile lander?
I tried nifty player
http://www.varal.org/media/niftyplayer/
but it doesnt seem to play on my iphone.... Desktop it plays fine, so im not sure if the scripts used in nifty player are not supported on mobile and/or iphone...
Any other alternatives or best practices?
Try this
<audio autoplay="autoplay" preload> <source src="images/alert.ogg" type="audio/ogg" /> <source src="images/alert.mp3" type="audio/mpeg" /> </audio>
thanks, i just tried it....
Still works on my desktop but no sound on my iphone...
https://developer.mozilla.org/en-US/...udio_and_video''
and
http://caniuse.com/audio
Should work on your iPhone if done right.
Not I don't think you want autoplay="autoplay". More like:
<audio src="something.mp3" autoplay controls></audio>
Add preload="..." if you want to control that.
@zeno, tried this, but still doesnt seem to work on iphone....
I've tried audio and failed. Curious if anyone has actually got it to work across a bunch of phones.
The glaring issue is that Safari prevents the autoplay of audio. You can however use javascript to make something play the moment someone touches the screen, scrolls, clicks etc.
Otherwise audio should work fine on most mobile browsers? I haven't tested it.
im on google chrome on iphone... So, it appears you might not be able to do it on iphone...