From e1bcfa664751d613b8beaf37009e348e921a3f36 Mon Sep 17 00:00:00 2001 From: collidingScopes <166117863+collidingScopes@users.noreply.github.com> Date: Mon, 5 Aug 2024 03:58:36 -0400 Subject: [PATCH] Use mobile video record for Firefox --- kaleidoscope.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/kaleidoscope.js b/kaleidoscope.js index 7522f83..23c2f41 100644 --- a/kaleidoscope.js +++ b/kaleidoscope.js @@ -37,18 +37,23 @@ var loadingScreen = document.getElementById("coverScreen"); //detect user browser var ua = navigator.userAgent; var isSafari = false; +var isFirefox = false; var isIOS = false; var isAndroid = false; if(ua.includes("Safari")){ isSafari = true; } +if(ua.includes("Firefox")){ + isFirefox = true; +} if(ua.includes("iPhone") || ua.includes("iPad") || ua.includes("iPod")){ isIOS = true; } if(ua.includes("Android")){ isAndroid = true; } -console.log("isSafari: "+isSafari+", isIOS: "+isIOS+", isAndroid: "+isAndroid); +console.log("isSafari: "+isSafari+", isFirefox: "+isFirefox+", isIOS: "+isIOS+", isAndroid: "+isAndroid); + //video recording function var recordBtn = document.getElementById("recordVideoButton"); @@ -117,7 +122,7 @@ function getUserInputs(){ maxImageWidth = Math.ceil(canvasWidth/numTiles); //could be tweaked for custom output dimensions speedInputValue = Number(animationSpeedInput.value); - animationSpeed = 8000/speedInputValue * (numTiles/2); //larger value gives slower animation + animationSpeed = 8000/speedInputValue * (numTiles/2.5); //larger value gives slower animation console.log("animation speed: "+animationSpeed); videoDuration = Math.max(1,Math.min(60,Number(videoDurationInput.value))); console.log("video record duration (seconds): "+videoDuration); @@ -440,7 +445,7 @@ document.addEventListener('keydown', function(event) { }); function chooseRecordingFunction(){ - if(isIOS || isAndroid){ + if(isIOS || isAndroid || isFirefox){ startMobileRecording(); }else { recordVideoMuxer();