feat: update time formatting in DesktopVideoPlayer and MobileVideoPlayer to include hours

This commit is contained in:
kuekhaoyang
2025-11-18 13:12:16 +08:00
parent d92c2808c2
commit df437ce4ab
2 changed files with 8 additions and 6 deletions
+4 -3
View File
@@ -549,10 +549,11 @@ export function DesktopVideoPlayer({
// Format time helper
const formatTime = (seconds: number) => {
if (isNaN(seconds)) return '0:00';
const mins = Math.floor(seconds / 60);
if (isNaN(seconds)) return '0:00:00';
const hours = Math.floor(seconds / 3600);
const mins = Math.floor((seconds % 3600) / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs.toString().padStart(2, '0')}`;
return `${hours}:${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
};
return (
+4 -3
View File
@@ -401,10 +401,11 @@ export function MobileVideoPlayer({
const speeds = [0.5, 0.75, 1, 1.25, 1.5, 2];
const formatTime = (seconds: number) => {
if (isNaN(seconds)) return '0:00';
const mins = Math.floor(seconds / 60);
if (isNaN(seconds)) return '0:00:00';
const hours = Math.floor(seconds / 3600);
const mins = Math.floor((seconds % 3600) / 60);
const secs = Math.floor(seconds % 60);
return `${mins}:${secs.toString().padStart(2, '0')}`;
return `${hours}:${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
};
return (