我正在尝试设置一个音频精灵与Howler.js。基本的sprite功能可以正常工作,但是如果我暂停了一个sprite,我如何才能恢复它的播放呢?打电话给play()对我没用。
sound = new Howl({
urls: ['http://<your audio asset>'],
sprite: {
frame1: [260, 4400],
frame2: [4700, 2400],
frame3: [7100, 2200],
frame4: [9300, 2100],
frame5: [11400,5100],
frame6: [16500, 3000]
}
});
----------------HTML-------------------
<button onclick="sound.play('frame6')">
Play Frame 6
</button>
<button onclick="sound.pause()">
Pause
</button>
<button onclick="sound.play()">
Play
</button>我的步骤顺序
发布于 2017-02-06 17:11:18
只需在pause()和play()处设置'frame6‘,它就能工作.
----------------HTML-------------------
<button onclick="sound.play('frame6')">
Play Frame 6
</button>
<button onclick="sound.pause('frame6')">
Pause
</button>
<button onclick="sound.play('frame6')">
Play
</button>https://stackoverflow.com/questions/37402901
复制相似问题