Search code examples
javascripthtmlhtml5-audio

HTML audio Element how to replay?


I setup a HTML5 page, that include a node. The page will to playing a music(mp3 format),but it just play sound to end, and I use javascript to control audio element,even so,I can't replay it and only STOP.

Does HTML5 audio Element support REPLAY? And how to?


Solution

  • please read this

    http://www.position-absolute.com/articles/introduction-to-the-html5-audio-tag-javascript-manipulation/

    and for replay event

    you can set option, on replay click

    audioElement.currentTime=0;
    audioElement.play();