Precise synchronization of two videoTextures

Hello,
I was looking for a solution to synchronize two video textures and I started with @RaananW 's solution

posted in this thread

However, after running this solution for 15-20 seconds, the two video clips get out of sync, and I am getting something like this

So I thought to improve this solution, by syncing these videos every time when they hit the end.

Unfortunately I have not seen any improvements. Moreover, if I also sync the video clips in ontimeudpate callback, the problems gets worse
So I am wondering (1) why onended and ontimeupdate do not work here and (2) how we can make these videos more in sync?
thank you

Maybe @sebavan has a trick ?

video texture synchronization | Babylon.js Playground (babylonjs.com) how is this one?

3 Likes

@RaananW Thank you! It works perfect on the desktop though I am getting some frames out of sync on my iPhone 14. But still it is much much better even on iPhone

1 Like