我如何设置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
我如何设置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
在媒体项目上调用.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);
});