It may be nice to move the following codes as a separate javascript file. It will be a ForwardRewindController. While initializing it, we need to pass the video object, forward button and rewind button to it. I feel the code is pretty clean to have a separate controller.