WebController - Class Creation Process

We create an instance of the class WebController using video_player as an argument. This argument is the ID of the tag that contains the video stream. We call the start() method from this object to start connecting to the stream and we add a keydown listener to the page to detect key press.

const webController = new WebController("video_player");
webController.start();
window.addEventListener(
  "keydown",
  (event) => {
    webController.onKeyDown(event);
  },
  true
);