1
我一直在尝试过去的几个小时让SoundManager工作,所以我可以在我的网站上播放音频循环。但是到目前为止,我甚至还没有能够获得音频播放。它使我感到困惑,因为我的代码看起来像我见过的大多数例子。我完全通过了故障排除测试。我也多次检查过这些文件是否在正确的目录中,并且正确命名。正是复制它即使和改变的目录和MP3文件的我根本没有声音JavaScript/SoundManager2 - 没有播放任何东西
Javascript SoundManager2 Problems
:
我也可能会注意到,我也试过张贴在这个线程的例子。我相当肯定,这不是我的安全设置,因为我已将macromedia设置为始终允许,并且使用soundmanager的nyan.cat完美工作。
到目前为止我的代码是这样的:
<html>
<head>
<script type="text/javascript" src="/script/soundmanager2-nodebug-jsmin.js"></script>
<script type='text/javascript'>
soundManager.url = '/swf/soundmanager2.swf';
soundManager.flashVersion = 9;
soundManager.useFlashBlock = false;
soundManager.onready(function() {
var looper = soundManager.createSound({
id: 'loop',
url: 'looplong.mp3',
autoLoad: true,
autoPlay: true,
loops: 9999999,
onload: function() {
this.play();
},
onfinish: function() {
},
volume: 50
});
</script>
</head>
<body>
<script type='text/javascript'>
document.bgColor='black';
looper.play({volume:50});
</script>
</body>
</html>
我问过类似的问题在[这个线程] [1]所以检查出来,看看它是否有帮助。 [1]:http://stackoverflow.com/questions/10077496/very-basic-js-coding-and-soundmanager2-or-not/10115105#10115105 – tomdot 2012-04-12 09:42:00