mirror of
https://github.com/movie-web/movie-web.git
synced 2024-11-13 11:35:06 +01:00
9 lines
260 B
TypeScript
9 lines
260 B
TypeScript
|
export function handleBuffered(time: number, buffered: TimeRanges): number {
|
||
|
for (let i = 0; i < buffered.length; i += 1) {
|
||
|
if (buffered.start(buffered.length - 1 - i) < time) {
|
||
|
return buffered.end(buffered.length - 1 - i);
|
||
|
}
|
||
|
}
|
||
|
return 0;
|
||
|
}
|