jeeliz / jeelizGlanceTracker

JavaScript/WebGL lib: detect if the user is looking at the screen or not from the webcam video feed. Lightweight and robust to all lighting conditions. Great for play/pause videos if the user is looking or not, or for person detection. Link to live demo.

Home Page:https://jeeliz.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GLANCETRACKERAPI.destroy() or stop()

santosh898 opened this issue · comments

Thanks for the lightweight library.
It would be better if there is a method to stop the tracker completely and stopping the camera stream, cleaning the canvas.
something like GLANCETRACKERAPI.destroy()

Hi @santosh898
I have added an option in the toggle_pause method, it can now shut down the camera video stream (so the camera light turns off).
I have updated the documentation and enabled this feature in the provided integration samples. You can check it out here: https://jeeliz.com/demos/glanceTracker/demos/integration/

GLANCETRACKERAPI.toggle_pause(true, true); --> pause and shut down camera
GLANCETRACKERAPI.toggle_pause(false, true); --> resume and re-get camera

When the tracker is paused and camera turned off, nothing is running, no loop or whatever.
The memory footprint is neglictible.

Best,
Xavier