JSFiddle - React, Tailwind, and code Playground

HTML

<video></video>

JavaScript

var myInterval = setInterval(function() { 
  var myVideo = document.getElementsByTagName('video')[0];

  console.log(myVideo);
  if (myVideo !=  null)
  {
  	clearInterval(myInterval);
    myVideo.id = 'video-stream';
    var colors = new tracking.ColorTracker(['magenta', 'cyan', 'yellow']);

    colors.on('track', function(event) {
      if (event.data.length === 0) {
        // No colors were detected in this frame.
      } else {
        event.data.forEach(function(rect) {
          console.log(rect.x, rect.y, rect.height, rect.width, rect.color);
        });
      }
    });

    tracking.track("#video-stream", colors);
  }
    else{
  	console.log('notFound')
  }

}, 5000);