Try to choose a media device that have the word "back" in it, if it doesn't find one falls back to the first. (#573)

This commit is contained in:
EdWorth120
2025-03-09 11:28:30 -03:00
committed by GitHub
parent 9fe509215d
commit 6797fcb58f

View File

@@ -34,7 +34,14 @@
sources.value = devices;
if (devices.length > 0) {
selectedSource.value = devices[0].deviceId;
for (let i = 0; i < devices.length; i++) {
if (devices[i].label.toLowerCase().includes("back")) {
selectedSource.value = devices[i].deviceId;
}
}
if (!selectedSource.value) {
selectedSource.value = devices[0].deviceId;
}
} else {
errorMessage.value = t("scanner.no_sources");
}