Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

109
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda