Video currentTime not working for certain videos hosted on PC

This is a strange one!

If you run the example video, you can press the button when the video is running and it will set the currentTime to 5.

All three videos have been converted the same way from a master video, using ffmpeg. The only difference is the -t time parameter. I have the same problem with other videos, not just this one - hopefully it will help identify a problem.

If you select Root, and drag the 3 videos across, you’ll notice that the 30 second one will correctly get the currentTime set to 5, and the 80 second one will get returned to 0 every time.

It would be great to know why the two videos behave differently. Feel free to fork and try to see if you can fix / isolate the issue.

This only occurs when preload isn’t set ( which you wouldn’t set for a large video file like this, for a faster start ). Is it possible that the duration of the video isn’t available to the video player for the larger file, when streaming? Maybe for the smaller file, the entire file falls within the stream buffer and therefore the duration is taken from there. That’s just a guess :slight_smile:

I think you forgot to post a link to the project :sweat_smile:

1 Like

It’s that time of the night :rofl: :sleeping:

Here’s the link…

I’m currently looking into hosting the video on S3, but it would be great to have control of short videos hosted on PlayCanvas as well of course.

Remember to clear your cache every so often, esp if the non-pre-load smaller videos become fully cached and their duration then seems to be available.

I think it’s something to do with how we access/store videos from the launch tab.

A published build seems fine:

It might be due to the id and hash we add as params to the URL

And the video DOM play may process that differently?

1 Like

That’s great to know that it’s an editor only issue, cheers for checking!