It drives me crazy. Here is the code that I use to set the current time:
$("#audio").click(function(e) { e.preventDefault(); mr_waveform_skip(e) }); function mr_waveform_skip(event) { clientX = event.clientX; left = event.currentTarget.offsetLeft; clickoffset = clientX - left; percent = clickoffset/event.currentTarget.offsetWidth audio_duration = audio_element.duration; duration_seek = percent*audio_duration; audio_element.currentTime = duration_seek;
I can't seem to set audio_element.currentTime just to get it!
And even worse, it works in fireFox! Chrome reloads to 0, no matter what.
This is what the above code is generated in the Firefox console:
CLICK: 63.82905432385121 Element: [object HTMLAudioElement] CurrentTime: 3.849546
And in Chrome:
CLICK: 63.82905432385121 Element: [object HTMLAudioElement] CurrentTime: 3.849546
Cm? The one! We see that Chromes sees the HTML audio element (since it can get the value). If I do audio_element.currentTime = 10; , it still doesn't work ( in Chrome , Firefox loyally restarts at 10).
yphil source share