Version 0.2.0-alpha - Ajout du Player

This commit is contained in:
2025-02-25 16:39:18 +01:00
parent b054c8a316
commit 6f3847138b
19 changed files with 5175 additions and 12 deletions

View File

@@ -0,0 +1,32 @@
function getReadableDuration(duration) {
var max = ""
duration *= 1000;
const maxhours = Math.floor(duration / 3600000);
var maxmin = Math.trunc(duration / 60000) - (Math.floor(duration / 60000 / 60) * 60);
var maxsec = Math.floor(duration / 1000) - (Math.floor(duration / 1000 / 60) * 60);
if (maxsec < 10) {
maxsec = `0${maxsec}`;
}
if(maxhours != 0) {
if (maxmin < 10) {
maxmin = `0${maxmin}`;
}
max = maxhours + "h" + maxmin + "m" + maxsec
} else {
max = maxmin + "m" + maxsec + "s"
}
return max
}
module.exports = {getReadableDuration}