I am producing an online course of videos and online exercises and would like people to be able to log in and track their progress.
Is there are way that I could measure the percentage of a youtube embed that someone had watched and mark it as complete if they had viewed, say more than 80%?
My best idea so far is to use getCurrentTime() when the player's state changes to PLAYING and then again every five seconds or so adding the difference to some kind of total. However if someone watched the first minute five times they'd end up with a ticked off video, even though they had not viewed the whole thing.
Is there a more elegant solution to calculate the % of a video viewed, rather than the above method that calculates the amount of time spent viewing the video?