eirtube/html/static/js/player/cacheInfo.js
2024-12-19 18:49:09 -06:00

22 lines
393 B
JavaScript
Executable File

export default modules => {
let self
self = {
pingCache: (videoName, callback, interval) => {
let doFetch
doFetch = () => {
fetch(`/cacheInfo?videoName=${videoName}`)
.then(r => r.json().then(r => {
const status = r.status
if (status == "found")
callback()
else
setTimeout(doFetch, interval)
}))
}
doFetch()
}
}
return self
}