@mahouuuuuuu Unfortunately I am not yet allowed to comment, but I am very much struggling with the same issue (and searching for a simple solution) – I would be happy if you could share the code for your solution with everyone here. :)
For Wordpress I found a solution if someone wants to offer a video course and needs to be sure that participants are watching the whole video(s) without jumping, but this plugin is 'far too much'/bloated (for my needs): LearnDash LMS + Video Progression.