Wednesday, 11 September 2013

Youtube android player api getCurrentTimeMillis only updates every 1 second

Youtube android player api getCurrentTimeMillis only updates every 1 second

I'm using the Youtube player android api (latest version, fetched from
https://developers.google.com/youtube/android/player/). In my app I've
added a timer that calls the player's getCurrentTimeMillis method every
200 msec. The problem is that the method returns the same value for each
second that passes by. for example, I get the following output after the
running the app:
1877 1877 1877 1877 1877 2878 2878 2878 2878 2878 3879 3879 3879 3879 3879
4880 4880 4880 4880 4880 5881
As you can see, the time effectively updates every 1 second (5 timer
ticks). The same happens with a timer delay of 100 msec (every 10 ticks).
This of course, does not happen with the javascript api or the AS3 api.
Does anyone have any idea why it happens and how can I get a higher
resolution?
I tried the same app on the Nexus 7 and Galaxy Nexus (both running android
4.3) and got the same results.
Thanks in advance! Roy

No comments:

Post a Comment