1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 09:49:28 +02:00

fix encoding progress bar

This commit is contained in:
DanielnetoDotCom 2020-10-22 13:50:04 -03:00
parent b95c175827
commit 8344fea983
3 changed files with 25 additions and 23 deletions

View file

@ -920,4 +920,24 @@ function isPlayingAds() {
function playerHasAds() {
return ($("#mainVideo_ima-ad-container").length > 0);
}
function countTo(selector, total) {
current = parseInt($(selector).text());
total = parseInt(total);
if (!total || current >= total) {
$(selector).removeClass('loading');
return;
}
var rest = (total - current);
var step = parseInt(rest / 100);
if (step < 1) {
step = 1;
}
current += step;
$(selector).text(current);
var timeout = (500 / rest);
setTimeout(function () {
countTo(selector, total);
}, timeout);
}