fix: save progress on player actions

This commit is contained in:
2026-05-24 02:29:54 +02:00
parent 9da9edae7f
commit 2ac8660435
4 changed files with 43 additions and 21 deletions

View File

@@ -1,4 +1,5 @@
import { state } from './state';
import { saveProgress } from './progress';
export const formatTime = (seconds: number): string => {
if (!Number.isFinite(seconds) || seconds < 0) return '00:00';
@@ -203,6 +204,7 @@ export const setupControls = (): void => {
state.video.addEventListener('pause', () => {
updatePlayPauseIcons(false);
showControls();
void saveProgress();
});
state.video.addEventListener('volumechange', syncVolumeUI);