QR Scanner Camera Device Selector #27

Open
opened 2026-01-16 04:45:44 +00:00 by tonym · 0 comments
Owner

Summary

Allow users to select which camera device the QR scanner uses.

Upstream Issue

Problem

QR scanner defaults to first available camera device. When virtual cameras (OBS, etc.) are installed, they may be selected instead of the actual webcam. No way to switch cameras after initial permission grant.

Proposed Solution

1. Camera Selector Dropdown

  • Show all available video input devices in QR Scanner modal
  • Let user select preferred camera
  • Use navigator.mediaDevices.enumerateDevices()

2. Persist Selection

  • Store selected device ID in localStorage
  • Remember preference across sessions
  • Fall back to first device if saved device unavailable

Implementation

// Get available cameras
const devices = await navigator.mediaDevices.enumerateDevices();
const cameras = devices.filter(d => d.kind === "videoinput");

// Show dropdown with camera labels
// Save selection to localStorage
## Summary Allow users to select which camera device the QR scanner uses. ## Upstream Issue - https://github.com/Donkie/Spoolman/issues/693 ## Problem QR scanner defaults to first available camera device. When virtual cameras (OBS, etc.) are installed, they may be selected instead of the actual webcam. No way to switch cameras after initial permission grant. ## Proposed Solution ### 1. Camera Selector Dropdown - Show all available video input devices in QR Scanner modal - Let user select preferred camera - Use `navigator.mediaDevices.enumerateDevices()` ### 2. Persist Selection - Store selected device ID in localStorage - Remember preference across sessions - Fall back to first device if saved device unavailable ## Implementation ```typescript // Get available cameras const devices = await navigator.mediaDevices.enumerateDevices(); const cameras = devices.filter(d => d.kind === "videoinput"); // Show dropdown with camera labels // Save selection to localStorage ```
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tonym/spoolman2#27
No description provided.