Video player currenttime not working cocos creator

I am using creator 2.4.0
videoplayer.currenttime giving 0 until i tap on player;
i need the timer to give the value as soon as the video start playing.

any help?

One workaround that we do in the projects is in code, set the video, play it, pause it (it can be one line after the other), then get the time. If one line afther other doesn’t work, wait the other frame to pause it. This should do the trick

Thank you, it works.
any workaround for audio?

I’m not fully adapted to 2.4 yet, but in 1.9 we used that same trick (using AudioEngine instead of AudioSource). But in 2.4 you have to load the audio asset instead of passing the path (we used this in 1.9), so, I can be wrong because I didn’t check it before comment, but I think that the audio asset has a duration property.

If I’m wrong, just try the same thing as the video.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.