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

Add option to swap video content.

Basically it changes the filename of 2 videos.
This commit is contained in:
daniel 2020-03-27 12:35:21 -03:00
parent 08b49d1601
commit 3693b8ecaa
18 changed files with 423 additions and 80 deletions

View file

@ -551,3 +551,12 @@ function playerPlay(currentTime) {
console.log("playerPlay: Player is Undefined");
}
}
function formatBytes(bytes,decimals) {
if(bytes == 0) return '0 Bytes';
var k = 1024,
dm = decimals <= 0 ? 0 : decimals || 2,
sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'],
i = Math.floor(Math.log(bytes) / Math.log(k));
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
}