Well, here's an explanation of some tests i did:
Link React(Create-React-App): https://codesandbox.io/s/react-gsap-control-video-55jv75
Link React/Nextjs13: https://codesandbox.io/p/sandbox/react-next13-gsap-control-video-fd969p
Link VanillaJS: https://codepen.io/maxleon52/pen/vYVbvXX
I replicated the example in 3 ways, however, in NextJs, it doesn't work. Motive? I have no idea! No error appears on the console to debug the code. If anyone knows how to explain me, comment below, I will be grateful for your help.
The steps used were:
1 - Install ffmep, See the doc at: https://ffmpeg.org/documentation.html;
2 - Do the conversion of the video, here is a command line example:
ffmpeg -i NAME_YOUR_VIDEO.mp4 -vf scale=960:-1 -movflags faststart -vcodec libx264 -crf 20 -g 1 -pix_fmt yuv420p NAME_EXIT_YOUR_VIDEO.mp4
3 - Replicate the example code above. That's it.
PS: I didn't develop the code, I just found it at this link:https://codepen.io/wisearts/full/ExZGrbZ
All the credits are his, I just adapted it to my need, with react and nextjs.