private void seekToPosition(long newPosition) {
        if (player == null || playerView == null)
            return;

        player.setSeekParameters(SeekParameters.EXACT);

        // Start of the video reached
        if (newPosition <= 0) {
            player.seekTo(0);

            if (seekListener != null)
                seekListener.onVideoStartReached();
            return;
        }

        // End of the video reached
        long total = player.getDuration();
        if (newPosition >= total) {
            player.seekTo(total);

            if (seekListener != null)
                seekListener.onVideoEndReached();
            return;
        }

        // Otherwise
        playerView.keepInDoubleTapMode();
        player.seekTo(newPosition);
    }
Seeks the video to desired position.
Calls interface functions when start reached ([SeekListener.onVideoStartReached])
or when end reached ([SeekListener.onVideoEndReached])

@param newPosition desired position
app/src/main/java/com/brouken/player/dtpv/youtube/YouTubeOverlay.java