refactor JS logic for fixing possition on video player