@valera-rozuvan 

if (
   this.videoPlayer.stopAtEndTime &&
…

instead.