mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 11:11:20 -08:00
refactor(mediabunny): [PKG-MB-04] checkpoint typed shim and event cleanup
This commit is contained in:
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 }
|
||||
}
|
||||
Reference in new issue
Block a user