mirror of
https://github.com/screentinker/screentinker.git
synced 2026-05-15 07:32:23 -06:00
Fix web player single-video loop and service worker cache errors
- Loop single-video playlists natively instead of destroying/recreating the element - Skip caching HTTP 206 partial responses in service worker (video range requests) - Bump service worker cache version to invalidate old cache Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d67dd41056
commit
d18045a386
|
|
@ -539,7 +539,8 @@
|
|||
video.playsInline = true;
|
||||
video.crossOrigin = 'anonymous';
|
||||
video.style.cssText = 'width:100%;height:100%;object-fit:contain;background:#000';
|
||||
video.onended = () => nextItem();
|
||||
video.loop = (playlist.length === 1);
|
||||
video.onended = () => { if (!video.loop) nextItem(); };
|
||||
video.onerror = (e) => { console.error('Video error:', src, e); setTimeout(nextItem, 3000); };
|
||||
video.onloadeddata = () => {
|
||||
console.log('Video loaded:', item.filename, 'muted:', video.muted);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
const CACHE_NAME = 'rd-player-v1';
|
||||
const CACHE_NAME = 'rd-player-v2';
|
||||
const STATIC_ASSETS = ['/player/', '/player/index.html', '/socket.io/socket.io.js'];
|
||||
|
||||
// Install: cache static assets
|
||||
|
|
@ -29,7 +29,7 @@ self.addEventListener('fetch', (event) => {
|
|||
caches.match(event.request).then(cached => {
|
||||
if (cached) return cached;
|
||||
return fetch(event.request).then(response => {
|
||||
if (response.ok) {
|
||||
if (response.ok && response.status === 200) {
|
||||
const clone = response.clone();
|
||||
caches.open(CACHE_NAME).then(cache => cache.put(event.request, clone));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue