Moved the repeat check outside of getNextTrackPosition so that it can be checked in the ended event instead.