about summary refs log tree commit diff stats
path: root/js/pico-cam
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-07-04 08:55:07 -0400
committerelioat <elioat@tilde.institute>2024-07-04 08:55:07 -0400
commit5d2993d7ad5b7a118421c2f783cfbeb1ab4aca00 (patch)
tree54eea023c2e987568b909ba1fcba747ab9ef26aa /js/pico-cam
parentfdb2c861e4740a9158b27afec6353d659a9774d1 (diff)
downloadtour-5d2993d7ad5b7a118421c2f783cfbeb1ab4aca00.tar.gz
*
Diffstat (limited to 'js/pico-cam')
-rw-r--r--js/pico-cam/pico-cam.js8
-rw-r--r--js/pico-cam/service-worker.js8
2 files changed, 10 insertions, 6 deletions
diff --git a/js/pico-cam/pico-cam.js b/js/pico-cam/pico-cam.js
index d2c06f3..31c1381 100644
--- a/js/pico-cam/pico-cam.js
+++ b/js/pico-cam/pico-cam.js
@@ -103,17 +103,19 @@ captureVideoButton.addEventListener('click', () => {
                 reject(event.error);
             };
 
-            // Set the desired frame rate
+            // Set the frame rate
             mediaRecorder.onstart = () => {
                 const options = mediaRecorder.videoBitsPerSecond;
                 mediaRecorder.videoBitsPerSecond = options * frameRate;
             };
 
-            // console.log('Starting recording...');
             mediaRecorder.start();
+            captureVideoButton.disabled = true;
+            captureVideoButton.textContent = 'Recording...';
             setTimeout(() => {
-                // console.log('Stopping recording...');
                 mediaRecorder.stop();
+                captureVideoButton.disabled = false;
+                captureVideoButton.textContent = 'Capture Video';
             }, duration);
         });
     };
diff --git a/js/pico-cam/service-worker.js b/js/pico-cam/service-worker.js
index 9540cfb..2a2da64 100644
--- a/js/pico-cam/service-worker.js
+++ b/js/pico-cam/service-worker.js
@@ -1,8 +1,10 @@
-var CACHE_NAME = 'pico-cam-v3';
+var CACHE_NAME = 'pico-cam-v4';
 var urlsToCache = [
   './',
   './index.html',
-  './pico-cam.js'
+  './pico-cam.js',
+  './service-worker.js',
+  './favicon.ico'
 ];
 
 self.addEventListener('install', function(event) {
@@ -30,7 +32,7 @@ self.addEventListener('fetch', function(event) {
 });
 
 self.addEventListener('activate', function(event) {
-    var cacheWhitelist = ['pico-cam-v3'];
+    var cacheWhitelist = ['pico-cam-v4'];
     event.waitUntil(
         caches.keys().then(function(cacheNames) {
             return Promise.all(