Page 1 of 1

polling input.time and converting it

Posted: 09 Jun 2009 13:27
by Shadow2531
Looking at <http://www.videolan.org/doc/play-howto/ ... l#id310965> (version > 0.8.5.1), I can see there's an option to get the video position in milliseconds via the input.time getter. However, I have 2 questions.

1. Is there a way to pass the plugin a callback function that the plugin calls (at some interval) to show time updates? Or, do I have to use setInterval in JS to poll input.time?

For example, plugin.onpositionchange = function(ps) {alert(ps + "ms");};

2. input.time returns in milliseconds. However, I want it in years (optional) + days + hours + minutes + seconds + milliseconds. I can do this in JS, but does the plugin offer any way for it to do the conversion?

For example, an input.position object that had getYearPart, getDayPart, getHourPart, getSecondPart and getMillisecondPart functions would be great. Yet, I don't see anything like that.

Thanks

Re: polling input.time and converting it

Posted: 09 Jun 2009 13:38
by thannoy
I think the answer is "no" for both questions. I don't think such JS callback mecanism exists nor I think you cas ask the plugin to convert the time.

Re: polling input.time and converting it

Posted: 16 Jun 2009 02:26
by Shadow2531
Thanks.

It'd be cool if you could though.