mirror of
https://github.com/iv-org/invidious.git
synced 2026-09-06 00:52:45 -05:00
fix(player): align long caption timestamps with VTT
This commit is contained in:
parent
0d3573a723
commit
ca670d5974
@ -633,10 +633,14 @@ function parseCaptionTimestamp(value) {
|
|||||||
const parsedPart = parseFloat(part);
|
const parsedPart = parseFloat(part);
|
||||||
if (!isFinite(parsedPart)) return null;
|
if (!isFinite(parsedPart)) return null;
|
||||||
|
|
||||||
if (i > 0 && i < clockParts.length - 1 && parsedPart >= 60) return null;
|
if (clockParts.length === 3 && i === 1 && parsedPart >= 60) return null;
|
||||||
if (i === clockParts.length - 1 && clockParts.length > 1 && parsedPart >= 60) return null;
|
if (i === clockParts.length - 1 && clockParts.length > 1 && parsedPart >= 60) return null;
|
||||||
if (i === clockParts.length - 1) seconds += parsedPart;
|
if (i === clockParts.length - 1) seconds += parsedPart;
|
||||||
else seconds += parsedPart * Math.pow(60, clockParts.length - i - 1);
|
else {
|
||||||
|
const multiplier = clockParts.length === 2 && i === 0 && parsedPart >= 60 ?
|
||||||
|
3600 : Math.pow(60, clockParts.length - i - 1);
|
||||||
|
seconds += parsedPart * multiplier;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return seconds;
|
return seconds;
|
||||||
|
|||||||
BIN
screenshots/caption-word-timing.gif
Normal file
BIN
screenshots/caption-word-timing.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 28 KiB |
Loading…
x
Reference in New Issue
Block a user