Features
Webcam Tester
Build a Webcam Testing Component in a Next.js App Router app with the following capabilities, UI behaviors, and data model. It should function independently but follow the same structure as the microphone testing feature.
📷 Webcam Detection & Access
- Detect and list all connected webcams
- Show their device names or fallback to
Unknown Webcam
- Show their device names or fallback to
- Handle all permission/access states:
- ❌ Empty state → no webcams detected
- 🚫 Denied state → user blocked camera access, show instructions
- ⚠️ Error state → unknown issue fallback
🔴 Live Webcam Preview
- Show a live video feed from the selected webcam
- Allow user to select a different device from a dropdown if multiple are present
- Indicate which device is currently active
🎥 Recording Interface
-
Controls:
- Start, Pause, Resume, Stop recording
- Timer works just like mic version:
- Starts at
0s
- Pauses and resumes correctly
- Starts at
-
After stopping:
- Display a video player preview
- Allow download as MP4 or WebM
-
Support for multiple recordings
- Each recording shows:
- Editable title (
Recording - <timestamp>
) - Video thumbnail preview (from 1s in)
- Play/pause controls
- Seek by clicking timeline
- Delete and download buttons
- Editable title (
- Each recording shows:
⚙️ Playback Controls
- Skip ±5s buttons (with boundaries)
- Playback speed options:
- Slow:
0.25x
,0.5x
,0.75x
- Fast:
1.25x
,1.5x
,1.75x
,2x
- Slow:
- Toggle playback loop mode
♿ Accessibility
- All controls must be:
- Fully keyboard accessible
- Aria-labeled
- Have clear focus states
- Hotkeys:
Space
= play/pauseR
= recordB/F
= skip 5s backward/forward
💾 Storage & Persistence
- Data is stored in localStorage for now
- Should persist on reload
- Later stored in PostgreSQL via Drizzle ORM
🧱 Data Model — LocalStorage
Example JSON
Utility for LocalStorage
🐘 PostgreSQL Schema with Drizzle ORM
Schema
Notes:
videoUrl
can be:- A base64 string
- Or an uploaded URL (Supabase, S3, etc.)
thumbnailUrl
is a snapshot from the video for preview- This model supports hydration from localStorage
Let me know if you want:
- 📤 A migration tool from localStorage to Postgres
- 🧑🎨 A UI sketch using Shadcn components
- 🖥️ A "device tester" dashboard that combines mic + cam + speakers
Microphone Tester Feature Prompt
A feature prompt for the Microphone Tester component which I still want to implement for my pheripherals tester tool.
Practical Electron + Prisma Integration Guide
A practical, example-driven guide for integrating Prisma with Electron, featuring a real-world task management system