diff --git a/index.html b/index.html
index c10dec0..6d7ef6b 100644
--- a/index.html
+++ b/index.html
@@ -154,13 +154,6 @@
document.getElementById("hand-detector-ready").innerText = "True";
});
- const warmupInterval = setInterval(async () => {
- if (bodyDetector.isReady() && faceDetector.isReady() && handDetector.isReady()) {
- clearInterval(warmupInterval);
- (await Camera.getSelectElement()).disabled = false;
- }
- }, 100);
-
let camera = null;
let resizeTimeout = null;
const updateDisplay = async () => {
@@ -215,6 +208,18 @@
}
};
+ const warmupInterval = setInterval(async () => {
+ if (bodyDetector.isReady() && faceDetector.isReady() && handDetector.isReady()) {
+ clearInterval(warmupInterval);
+
+ deviceSelect.removeAttribute("disabled");
+ if (deviceSelect.length > 1) {
+ deviceSelect.options[1].setAttribute("selected", "");
+ deviceSelect.onchange();
+ }
+ }
+ }, 100);
+
const bodyDetectorStats = new StatRecorder(30);
bodyDetector.addEventListener("updated", e => {
bodyDetectorStats.record(e.detail.runtime);