3

我一直在尝试在 iPhone 5 上测试 soundmanager 2,但没有让播放器播放文件。调试输出显示以下内容:

mySound: suspend
mySound: loadstart
mySound: waiting
soundManager.load(): current URL already assigned.
mySound: load (rain.mp3)
mySound: play(): Loading - attempting to play...
mySound: play(): Already playing (multi-shot)
soundManager.load(): current URL already assigned.
mySound: load (rain.mp3)
mySound: Ignoring request to load again
soundManager.load(): current URL already assigned.
mySound: load (rain.mp3)
mySound: play(): Loading - attempting to play...
soundManager.load(): current URL already assigned.
mySound: load (rain.mp3)
soundManager.load(): current URL already assigned.
mySound: load (rain.mp3)
mySound: load (rain.mp3)
mySound: load (rain.mp3)
mySound: Using HTML5
mySound: Merged options:
soundManager.createSound(): mySound (rain.mp3)
SoundManager 2: Ready.
SoundManager 2 HTML5 support: mp3 = true, mp4 = true, ogg = true, opus = true, wav = true
SoundManager 2: Using singleton HTML5 Audio() pattern for this device.
SoundManager V2.97a.20130512 (HTML5-only mode)

我有一个非常简单的测试页面:

<html>
<head>
<title>
</title>
<script type="text/javascript" src="assets/js/controls/soundmanager2.js?<?php echo time(); ?>"></script>

<script>
soundManager.setup({
    url: '/path/to/swf-files/',
    flashVersion: 9, // optional: shiny features (default = 8)
    // optional: ignore Flash where possible, use 100% HTML5 mode
    preferFlash: false,
    onready: function() {
    // Ready to use; soundManager.createSound() etc. can now be called.


    soundManager.createSound({
        id: 'mySound',
        url: 'rain.mp3',
        autoLoad: true,
        autoPlay: true,
        onload: function() {
            alert('The sound '+this.id+' loaded!');
        },
        volume: 50
        });
    }
});
</script>
</head>
<body></body>
</html>

他们的演示站点实际上可以在 iphone 上找到,但显然有些东西设置不同以使其工作。

谢谢。

4

0 回答 0