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:
parent
b95c175827
commit
8344fea983
3 changed files with 25 additions and 23 deletions
|
@ -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);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue