New Vid currentTime

i am making a video player (using new Vid) with a seek bar and i ran into two problems:

  1. the first frame of the video is not shown. nothing is shown actually, the place where the video is located is empty
  2. if i click the play video button and then i click anywhere on the seek bar, the video goes to the point i clicked and plays as one would expect. but if i don't click the play button and instead click on the seek bar, the video goes to the point i clicked but instead of showing a video frame it shows nothing and only when i move the mouse the video frame comes up
    it seems like clicking on the seek bar works almost ok (currenTime is still slow) only if the play button was clicked earlier

the doc files suggest the use of fastSeek if currentTime property is too slow, but fastSeek is not supported by Chrome or Edge and even though it works with Firefox you still have to move the mouse again to see the video frame...

if i use document.createElement('video') and bitmap to create the video player, i still get the same problems. the first video frame is shown only if i roll over a button with a click listener(!) (simply moving the mouse anywhere else on the stage doesn't work) and setting the currentTime requires a mouse move to show the video frame (nothing is shown before moving the mouse)
that was not the case with version nft/00 or earlier
the bits example video (ZIM BITS - Video in JavaScript HTML 5 Canvas and CreateJS - Tips, Techniques and Tutorials) works ok (as far as setting currentTime is concerned) but uses version cdn/01

is there a workaround for these problems or do i have to use an older version of ZIM.js to make the video player?

any suggestions much appreciated

We can't show the video until the stage is interacted with - you could make a screenshot and show that to start.

Looks like it is a stage update issue otherwise - here is an example with Ticker.always() just to make it easier.

https://zimjs.com/zim/assets7.html

I don't like the flashing as the video is scrubbed - not sure why it is doing that. Maybe we can do some test to see if the video is returning white and if so, don't draw. I think the flashing is showing in the ZIM Bits - older version too.

1 Like

Good point about the fastSeek - where did you see us mention it and we will update it to say Firefox only.

thank you!

i used Ticker.always() in the init function and currectTime is much more responsive (it shows the frame with a small delay, but i don't have to move the mouse to see the frame)

because i've noticed that this thing was happening only if the video has not been played yet, i added a Ticker.alwaysOff() in the play button listener

video.play().pause() does show the first frame of the video! it produces an error on Chrome (play() failed because the user didn't interact with the document first) but the player works ok

1 Like

Right... the user is supposed to interact before we can play() - same as a sound.