unityController - Class Creation Process

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

let unityVideo = new unitySample.UnityController("video_player");
unityVideo.onConnect();
window.addEventListener("keydown", (event) => { unityVideo.onKeyDown(event); }, true);