I am working on a project where it is required to skip to a particular time, triggered by a click event. I am using audio.js and html5 'audio' tag. This worked fine in other browsers, but in firefox, the audio gets stuck:
JsFiddle: http://jsfiddle.net/LRW3U/
Javascript:
$('h1').click(function(){
audiojs.events.ready(function() {
var as = audiojs.createAll({
css: false,
preload: true,
});
audio = as[0];
});
$('audio').bind('canplaythrough', function () {
$(this)[0].currentTime = 10;
audio.play();
});
})
HTML
<h1>Play</h1>
<audio src="http://upload.wikimedia.org/wikipedia/commons/a/a9/Tromboon-sample.ogg" preload controls />
Again this happens only in firefox!
Please help!