我想在跨平台的网络浏览器上播放音频。知道怎么做吗?我试过soundmanager2但似乎没有在Android模拟器上工作。我的代码如下
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<script type="text/javascript" charset="utf-8" src="soundmanager2.js"></script>
<script type="text/javascript" src="jquery.mobile/jquery-1.7.2.min"></script>
<script type="text/javascript" src="jquery.mobile/jquery.mobile-1.1.1.js"></script>
<script type="text/javascript" charset="utf-8" src="cordova-2.0.0.js"></script>
<script type="text/javascript">
$(function () {
$.ajax({
url: 'soundmanager2.js',
dataType: 'script',
success:
{
soundManager.debugMode = true;
soundManager.defaultOptions.volume = 50
soundManager.debugFlash = true;
// enable flash debug output for this page
soundManager.url = '/android_asset/www/swf/soundmanager2.swf';
soundManager.flashVersion = 8;
// optional: shiny features (default = 8)
soundManager.useFlashBlock = false;
// optionally, enable when you're ready to dive in
//enable HTML5 audio support, if you're feeling adventurous. iPad/iPhone will always get this.
//soundManager.useHTML5Audio = true;
soundManager.onready(function () {
soundManager.createSound('helloWorld', '/android_asset/www/maybe.mp3');
soundManager.play('helloWorld');
});
}
});
</script>
</head>
<body>
</body>
</html>