public void openAndSeek(PagedList<PagedListEntry> list, int i, double s) {
   // if track is already playing, just seek
   if (list.get(i) == currentTrack) {
     seek(new Duration(player.getTotalDuration().toMillis() * s));
   } else {
     open(list, i);
     // wait for the player to load the meta data
     player.setOnPlaying(() -> seek(new Duration(player.getTotalDuration().toMillis() * s)));
   }
 }
Beispiel #2
0
 @FXML
 private void handleProgress(MouseEvent event) {
   if (event.getButton() == MouseButton.PRIMARY) {
     if (play = true) {
       mp.seek(
           Duration.seconds((mp.getTotalDuration().toSeconds() * timeSlider.getValue() / 100)));
     }
   }
 }