开发者

audio tag on Android device

开发者 https://www.devze.com 2023-03-27 23:13 出处:网络
This thread talks about the audio tag on the Android, but I\'m not sure what the conclusion is as of August, 2011.

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 mak开发者_JAVA百科e an Android device go doink?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消