Trying to create dynamic overlays using JAVA and Angukar-js

I am trying to create dynamic overlays on a live Stream. I am unable to find any tutorial. I tried to use REST API but that doesn’t reflect changes in runtime. I went through OverlaysExample Java code but I have no clues how to integrate to my web page so that I can create dynamic overlays. Please Help