Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Webgazer used in eyetracking

I'm looking to hide the webgazer video feed using Javascript. The following code displays video feed and how to hide the video feed as my task is to give more space for displaying diagrams and text.

window.onload = function() {
  webgazer.setRegression('ridge') /* currently must set regression and tracker */
    .setTracker('clmtrackr')
    .setGazeListener(gaze)
    .begin()
    .showPredictionPoints(true);

  var width = 320;
  var height = 240;
  var topDist = '100px';
  var leftDist = '400px';

  var setup = function() {
    var video = document.getElementById('webgazerVideoFeed');
    video.style.display = 'block';
    video.style.position = 'absolute';
    video.style.top = topDist;
    video.style.left = leftDist;
    video.width = width;
    video.height = height;
    video.style.margin = '0px';
    webgazer.params.imgWidth = width;
    webgazer.params.imgHeight = height;
    var overlay = document.createElement('canvas');
    overlay.id = 'overlay';
    overlay.style.position = 'absolute';
    overlay.width = width;
    overlay.height = height;
    overlay.style.top = topDist;
    overlay.style.left = leftDist;
    overlay.style.margin = '0px';
    document.body.appendChild(overlay);
    var cl = webgazer.getTracker().clm;

    function drawLoop() {
      requestAnimFrame(drawLoop);
      overlay.getContext('2d').clearRect(0, 0, width, height);
      if (cl.getCurrentPosition()) {
        cl.draw(overlay);
      }
    }
    drawLoop();
  };
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I would first try a "hidden" Visibility through CSS Styles in the Video object's setup:

video.style.visibility = hidden;

Another option is to use Opacity to control transparency:

video.style.opacity = 0.0; //# range from min 0.0 (see-thru colors) up to 1.0 max (solid colors)

Finally you can try Z-Index for putting the Video object on a layer under everything:
(consider having a background fill via a screen-sized Div/Shape/Image, to hide the video behind it)

video.style.zIndex = -2; //# default layer level/index is 0
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!