4

This thread talks about the audio tag on the Android, but I'm not sure what the conclusion is as of August, 2011.

Here's what I've got using jQuery mobile. This works on my iPod touch, but not on an Android device:

    <link rel="stylesheet" href="http://code.jquery.com/mobile/latest/jquery.mobile.css" />
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
    <script src="http://code.jquery.com/mobile/latest/jquery.mobile.js"></script>
...
    <a href="JavaScript:;" data-role="button" id="doink">Doink!</a>
...
    <audio id="doink-wav" src="doink.wav" preload="auto"></audio>
    <script src="Click.js"></script>

Click.js is:

var wav = $('#doink-wav')[0];
$('#doink').click(function() {
    wav.play();
});

Q: Using HTML/JavaScript, how do you make an Android device go doink?

Community
  • 1
  • 1
Phillip Senn
  • 46,771
  • 90
  • 257
  • 373

1 Answers1

1

You could try the Buzz api,

Buzz is a small but powerful Javascript library that allows you to easily take advantage of the new HTML5 audio element. It degrades gracefully on non-modern browsers.

Julien Lafont
  • 7,869
  • 2
  • 32
  • 52