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
If the server hosting the video does not support seeking on client (HTTP RangeRequest), the command
audioElement.currentTime=0;
from @JapanPro's answer is silently ignored in Chromium. This behavior is filled as crbug #121765.
There is a handy guide on MDN how to configure your server to play nice. But if you cannot, I had success with doing
audioElement.load();
which unsurprisingly reloads the audio source and seeks to the start as a side effect. Not nice, but it is quite intuitive and it works.
source: http://www.whatwg.org/specs/web-apps/current-work/#loading-the-media-resource