fix: on chrome129, a supported video that fails to fetch the cover wasn't playable #759

Massimo Melina committed Oct 5, 2024 at 18:59 UTC 53fd5a52c332b52bc5cb36e9cf703a132e02a003
1 file changed +2
frontend/src/show.ts
+2
@@ -181,6 +181,8 @@ export function fileShow(entry: DirEntry, { startPlaying=false } = {}) {
181 function goNext() { go(+1) }
182
183 function curFailed() {
184 + const mediaError = (document.querySelector('.showing-container .showing') as any)?.error?.code // only present in video/audio elements
185 + if (mediaError === 2) return // happens when chrome fails to fetch cover for videos. We don't skip the file for this reason. Tested on chrome129/windows
186 if (cur !== lastGood.current)
187 return go()
188 setLoading(false)