chore: format player storage and timeline

This commit is contained in:
2026-05-28 11:28:36 +02:00
committed by Milas Holsting
parent d66eb79295
commit 2172d32dc6
2 changed files with 9 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
export type StorageLike = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>; export type StorageLike = Pick<Storage, "getItem" | "setItem" | "removeItem">;
const getLocalStorage = (): StorageLike | null => { const getLocalStorage = (): StorageLike | null => {
try { try {

View File

@@ -1,6 +1,6 @@
import type { TimelineBounds } from './types'; import type { TimelineBounds } from "./types";
import { state } from './state'; import { state } from "./state";
import { formatTime } from './controls'; import { formatTime } from "./controls";
// cached to avoid recalc on every timeupdate // cached to avoid recalc on every timeupdate
let cachedBounds: TimelineBounds = { start: 0, end: 0, duration: 0 }; let cachedBounds: TimelineBounds = { start: 0, end: 0, duration: 0 };
@@ -124,11 +124,11 @@ export const updateTimeline = (currentTime: number): void => {
const b = getBounds(); const b = getBounds();
if (b.duration <= 0) { if (b.duration <= 0) {
progress.style.width = '0%'; progress.style.width = "0%";
buffered.style.width = '0%'; buffered.style.width = "0%";
scrubber.style.left = '0%'; scrubber.style.left = "0%";
timeDisplay.textContent = '00:00'; timeDisplay.textContent = "00:00";
durationDisplay.textContent = '00:00'; durationDisplay.textContent = "00:00";
return; return;
} }