<!DOCTYPE html>
<html>
<body>
<audio id="myAudio" controls>
<source src="/i/audio/song.mp3" type="audio/mpeg">
<source src="/i/audio/song.ogg" type="audio/ogg">
您的浏览器不支持 audio 元素。
</audio><br><br>
<button onclick="getPlaySpeed()" type="button">默认播放速度是多少?</button>
<button onclick="setPlaySpeed()" type="button">将视频设置为快速播放</button>
<script>
var x = document.getElementById("myAudio");
function getPlaySpeed() {
alert(x.defaultPlaybackRate);
}
function setPlaySpeed() {
x.defaultPlaybackRate = 2;
x.load();
}
</script>
</body>
</html>