Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

108
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda