private void updatePositionSlider(Duration currentTime) {
        if (positionSlider.isValueChanging()) {
            return;
        }
        final MusicPlayer mp = musicPlayer;
        final Duration total = mp.getTotalDuration();

        if (total == null || currentTime == null) {
            positionSlider.setValue(0);
        } else {
            positionSlider.setValue(currentTime.toMillis() / total.toMillis());
        }

    }