refactor(mediabunny): [PKG-MB-04] checkpoint typed shim and event cleanup

This commit is contained in:
Harvey Zhao committed 2026-09-12 18:27:33 +08:00
1 parent adba8a3d12
commit 9af253a5a9
24 files changed
+1478 -250

No files matched your search

@@ -0,0 +1,9 @@
export function clampVolume(value: unknown): number {
return Math.max(0, Math.min(1, Number(value) || 0))
}
export function timeRanges(duration: number, start: number, end: number): TimeRanges {
if (!duration || Number.isNaN(duration) || end <= 0)
return { length: 0, start: () => 0, end: () => 0 }
return { length: 1, start: () => start, end: () => end }
}