I want to get time passed (in percent) since video started in using YouTube iframe api.
I've done this so far:
$(".timeInPercent").click(function() {
var playerTotalTime = player.getDuration();
var playerCurrentTime = Math.round(player.getCurrentTime());
var playerTimeDifference = playerTotalTime / playerCurrentTime;
var playerTimePercent = playerTimeDifference * 100;
progress(playerTimePercent, $('#progressBar'));
});
I need this for a custom progression bar I made. I just need to update this progress(playerTimePercent, $('#progressBar'));
with time passed in percent.