brownhci / WebGazer

WebGazer.js: Scalable Webcam EyeTracking Using User Interactions
https://webgazer.cs.brown.edu
Other
3.54k stars 536 forks source link

How to check whether Webgazer is already running? #204

Closed Neele22 closed 3 years ago

Neele22 commented 3 years ago

I am creating an online psychological experiment using the calibration setup of webgazer. However, I would like to calibrate more often than just once. How can I check whether an instance of Webgazer is already running, so that .setGazeListener won't be ran multiple times and mess up the setup? I would love to know how to check whether Webgazer is paused, running, or has not (yet) started.

xanderkoo commented 3 years ago

I think what you're looking for is webgazer.isReady(), which should check if webgazer has already been initialized (i.e. if webgazer.begin() has been called and completed)