Search code examples
htmlgoogle-chromeplaybackhtml5-audio

Chrome <audio> playbackRate


I'm trying to use playbackRate attribute of the element in chrome. I've created simple markup:

<!DOCTYPE html>
<html>
<body>
    <audio id="myAudio" preload="metadata" defaultPlaybackRate="1.0" playbackRate="2.0" src="http://path_to_mp3_stream/" autoplay="true"></audio>
</body>
</html>

But playback stays at its normal rate. What am I doing wrong?

Google Chrome v20.0.1132.47.


Solution

  • Modifying markup in a following way made it work:

    <audio id="myplayer" preload="auto" controls="controls">
         <source src="http://path_to_mp3"></source> 
    </audio>
    <script>
         var player = document.getElementById("myplayer");
         player.playbackRate = 2;
    </script>
    

    UPD: Looks like there's related issue .