如何在SoundJS for Firefox,IE中正确设置位置 [英] How to set position correctly in SoundJS for Firefox, IE

查看:96
本文介绍了如何在SoundJS for Firefox,IE中正确设置位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 SoundJS 播放sn mp3文件并寻求特定内容位置。我正在使用:

I'm trying to use SoundJS to play sn mp3 file and seek to a specific position. I'm using:

instance.setPosition(10000);

可在Google Chrome中正常使用。但是在Mozilla Firefox中,我听到正确位置播放的声音,以及另一个位置播放的声音的第二个实例。

which works correctly in Google Chrome. But in Mozilla Firefox I hear the sound playing from the correct position, and a second instance of the sound also playing from another position.

在Internet Explorer中,声音开始播放从一开始就是这样。

In Internet Explorer, the sound starts playing again from the beginning.

这是一个jsFiddle (带有自动播放声音),这里是完整的javascript:

Here's a jsFiddle (with autoplaying sound) and here is the complete javascript:

createjs.Sound.registerPlugins([createjs.WebAudioPlugin, createjs.HTMLAudioPlugin, createjs.FlashPlugin]);
createjs.Sound.addEventListener("fileload", handleLoad);
createjs.Sound.registerSound("http://ivdemo.chaseits.co.uk/enron/20050204-4026(7550490)a.mp3", "sound");

function handleLoad(event) {
    var instance = createjs.Sound.play("sound");
    var ten = document.getElementById('ten-secs');
    ten.addEventListener('click', function (event) {
        instance.setPosition(10000);
    });
}

我对Firefox和IE做错了什么?

What am I doing wrong for Firefox and IE?

推荐答案

正如我在你的另一个问题中评论的那样,SoundJS的先前版本中存在一个错误,应该在最新的github 。您可以使用 TestSuite示例自行测试此行为。

As I commented on in your other question, there was a bug with in a previous version of SoundJS which should be fixed in the latest available on github. You can test this behavior yourself with the TestSuite example.

很好地使用jsfiddle来证明问题,通过by。

Nice use of jsfiddle to demonstrate the issue, by the by.

希望有所帮助。

这篇关于如何在SoundJS for Firefox,IE中正确设置位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆