diff --git a/install.webm b/install.webm deleted file mode 100644 index 5919142..0000000 Binary files a/install.webm and /dev/null differ diff --git a/sw.js b/sw.js index 1894630..ca93ebb 100644 --- a/sw.js +++ b/sw.js @@ -12,11 +12,10 @@ const { RangeRequestsPlugin } = workbox.rangeRequests; const coreAppFiles = [ '/', '/index.html', '/cancel_off.webp', '/cancel_on.webp', '/cdspin.gif', '/configure_off.webp', '/configure_on.webp', '/favicon.png', '/favicon.svg', - '/free_stuff_off.webp', '/free_stuff_on.webp', '/install.mp4', '/install_off.webp', - '/install_on.webp', '/install.webm', '/island.webp', '/isle.js', '/isle.wasm', - '/poster.pdf', '/read_me_off.webp', '/read_me_on.webp', '/run_game_off.webp', - '/run_game_on.webp', '/shark.webp', '/uninstall_off.webp', '/uninstall_on.webp', - 'app.js', 'style.css', 'manifest.json' + '/free_stuff_off.webp', '/free_stuff_on.webp', '/install_off.webp', '/install_on.webp', + '/island.webp', '/isle.js', '/isle.wasm', '/poster.pdf', '/read_me_off.webp', + '/read_me_on.webp', '/run_game_off.webp', '/run_game_on.webp', '/shark.webp', + '/uninstall_off.webp', '/uninstall_on.webp', 'app.js', 'style.css', 'manifest.json' ]; const gameFiles = [ @@ -36,10 +35,16 @@ const STATIC_CACHE_NAME = 'static-assets-v1'; self.addEventListener('install', (event) => { event.waitUntil( caches.open(STATIC_CACHE_NAME).then((cache) => { - return cache.addAll(coreAppFiles); + return cache.addAll(coreAppFiles).then(() => { + return fetch('/install.mp4', { cache: 'reload' }).then((response) => { + if (!response.ok) { + throw new Error('Video fetch failed!'); + } + return cache.put('/install.mp4', response); + }); + }); }) ); - self.skipWaiting(); }); registerRoute(