hiukim / mind-ar-js

Web Augmented Reality. Image Tracking, Face Tracking. Tensorflow.js
MIT License
2.21k stars 413 forks source link

arSystem.pause(true) -> targetLost not calling #546

Open geekz-reno opened 1 week ago

geekz-reno commented 1 week ago

On pause result was find, the camera still going and stop scanning, but targetLost event never calling. If i remove the pause function, both are calling perfectly.

const modelTarget = document.querySelector("#my-ar");
  modelTarget.addEventListener("targetFound", (event) => {
      console.log("TARGET FOUND");
      arSystem.pause(true); // pause AR, keep video
  });

  modelTarget.addEventListener("targetLost", (event) => {
    console.log("TARGET LOST");
    arSystem.unpause(); // unpause AR and video
  });
Kikuich commented 1 week ago

I think that's what the arSystem.pause() does. Since it's paused, it's not going to detect if a target was lost because it's not actively detecting anything at the moment.

What are you trying to do?