0

我如何设置playbackRate在Firefox?我有以下代码:

audio = document.createElement('audio');
audio.src = 'http://www.html5rocks.com/en/tutorials/audio/quick/test.ogg';
audio.playbackRate = 1.7;
audio.play();
console.log(audio.playbackRate); // Outputs 1
4

1 回答 1

0

在媒体项目上调用.play().load()将(可能)重置.playbackRate.

要么设置.playbackRate之后,要么使用.defaultPlaybackRate

这是一个小提琴证明:

audio = document.createElement('audio');
audio.src = 'http://www.html5rocks.com/en/tutorials/audio/quick/test.ogg';
audio.addEventListener("canplay", function () {
    audio.play();
    audio.playbackRate = 1.7;
    console.log(audio.playbackRate);
});
于 2013-09-16T12:26:47.573 回答