From 56cf0ba0d4e1d0ecb9a1cd2ea0982bef26ffb5b0 Mon Sep 17 00:00:00 2001 From: Jack Wilburn Date: Wed, 18 Mar 2026 22:56:03 -0600 Subject: [PATCH 01/12] Add webcam recording support --- public/libraries/screen-recording/config.json | 2 +- public/libraries/webcam-recording/config.json | 21 + .../assets/screen-recording-page.md | 3 +- .../assets/screen-recording.md | 2 +- public/library-screen-recording/config.json | 7 +- .../assets/webcam-recording-page.md | 5 + .../assets/webcam-recording.md | 13 + public/library-webcam-recording/config.json | 46 ++ .../individualStudy/StudyAnalysisTabs.tsx | 3 +- .../thinkAloud/ThinkAloudFooter.tsx | 53 +- .../tests/ThinkAloudAnalysis.spec.tsx | 3 +- src/components/ConfigSwitcher.tsx | 9 +- src/components/StepRenderer.tsx | 3 +- .../audioAnalysis/AudioProvenanceVis.tsx | 8 +- src/components/downloader/DownloadButtons.tsx | 29 +- .../downloader/tests/DownloadButtons.spec.tsx | 26 +- src/components/interface/AppAside.tsx | 9 +- .../interface/tests/AppAside.spec.tsx | 1 + .../screenRecording/ScreenRecordingReplay.tsx | 154 ++++-- .../tests/ScreenRecordingReplay.spec.tsx | 43 +- src/components/tests/ConfigSwitcher.spec.tsx | 1 + src/controllers/ComponentController.tsx | 4 +- .../tests/ComponentController.spec.tsx | 4 + src/parser/LibraryConfigSchema.json | 40 ++ src/parser/StudyConfigSchema.json | 44 ++ src/parser/types.ts | 4 + .../assets/ScreenRecording.tsx | 221 ++++---- .../assets/WebcamRecording.tsx | 167 ++++++ src/storage/engines/FirebaseStorageEngine.ts | 15 + src/storage/engines/LocalStorageEngine.ts | 12 + src/storage/engines/SupabaseStorageEngine.ts | 11 + src/storage/engines/types.ts | 35 ++ src/storage/tests/edgeCases.spec.ts | 8 + src/storage/tests/highLevel.spec.ts | 2 +- src/storage/tests/highLevelFirebase.spec.ts | 14 + src/store/hooks/tests/useRecording.spec.ts | 79 ++- .../hooks/tests/useRecordingConfig.spec.ts | 23 +- src/store/hooks/tests/useReplay.spec.tsx | 31 ++ src/store/hooks/useRecording.ts | 477 +++++++++++------- src/store/hooks/useRecordingConfig.ts | 16 +- src/store/hooks/useReplay.ts | 101 ++-- src/store/store.tsx | 4 + src/store/types.ts | 1 + src/tests/utils.ts | 4 + src/utils/handleDownloadFiles.ts | 122 ++++- src/utils/tests/handleDownloadFiles.spec.ts | 77 ++- src/utils/tests/useStudyRecordings.spec.ts | 16 + src/utils/useStudyRecordings.ts | 39 +- 48 files changed, 1483 insertions(+), 529 deletions(-) create mode 100644 public/libraries/webcam-recording/config.json create mode 100644 public/library-webcam-recording/assets/webcam-recording-page.md create mode 100644 public/library-webcam-recording/assets/webcam-recording.md create mode 100644 public/library-webcam-recording/config.json create mode 100644 src/public/libraries/webcam-recording/assets/WebcamRecording.tsx diff --git a/public/libraries/screen-recording/config.json b/public/libraries/screen-recording/config.json index c755ef381c..b2f9c922c3 100644 --- a/public/libraries/screen-recording/config.json +++ b/public/libraries/screen-recording/config.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/revisit-studies/study/v2.4.3/src/parser/LibraryConfigSchema.json", - "description": "This is a required library for screen recording. It provides a component that requests user permission for screen and microphone access. Then, it starts screen capture until the end of the study.", + "description": "This library requests permission for screen recording and any configured webcam or microphone recording, then keeps those capture streams active until the end of the study.", "components": { "screenRecordingPermission": { "description": "Get permission to start Screen recording", diff --git a/public/libraries/webcam-recording/config.json b/public/libraries/webcam-recording/config.json new file mode 100644 index 0000000000..9d331cdebd --- /dev/null +++ b/public/libraries/webcam-recording/config.json @@ -0,0 +1,21 @@ +{ + "$schema": "https://raw.githubusercontent.com/revisit-studies/study/dev/src/parser/LibraryConfigSchema.json", + "description": "This library requests webcam and optional microphone permission, then keeps those capture streams active until the end of the study.", + "components": { + "webcamRecordingPermission": { + "description": "Get permission to start webcam recording", + "type": "react-component", + "path": "libraries/webcam-recording/assets/WebcamRecording.tsx", + "nextButtonLocation": "belowStimulus", + "nextButtonText": "Continue", + "recordAudio": false, + "response": [{ + "hidden": true, + "type": "reactive", + "id": "webcamRecordingPermission", + "prompt": "Webcam recording enabled" + }] + } + }, + "sequences": {} +} diff --git a/public/library-screen-recording/assets/screen-recording-page.md b/public/library-screen-recording/assets/screen-recording-page.md index 6b429fc838..da5d66bdc9 100644 --- a/public/library-screen-recording/assets/screen-recording-page.md +++ b/public/library-screen-recording/assets/screen-recording-page.md @@ -1,9 +1,8 @@ # Demo Page -Any stimulus that follows the `screenRecordingPermission` page can be recorded. +Any stimulus that follows the `screenRecordingPermission` page can capture both screen and webcam video. Explore the webpage in the iframe below, then proceed to the next page.