How do I get the duration of the file being played in javascript?
I want to insert it here:
var seekbar = new Control.Slider('handle1', 'track1', {
onSlide: function(v) { v*totaltimehere },
onChange: function(v) { }
});So that it can get the correct time to seek to when the user clicks on the seekbar.
please see the source of the demo - http://home5.inet.tele.dk/nyboe/flash/mediaplayer/customize.htm
(linked from the demopage - http://home5.inet.tele.dk/nyboe/flash/mediaplayer )
it uses this line:
if(typ == "time") { currentPosition = pr1; document.getElementById("progressimg").style.width = currentPosition/((pr2+pr1)/100)+"%" ;}