JavaFX setOnEndOfMedia on next MediaPlayer
问题 I have List<MediaPlayer> that is populating by private List<MediaPlayer> players() { for (String file : path.list((dir1, name) -> { if (name.endsWith(SUPPORTED_VIDEO_FILE_EXTENSIONS)){ return true; } return false; })) { players.add(createPlayer(Paths.get(path + "/" + file).toUri().toString())); System.out.println(Paths.get(path + "/" + file).toUri().toString()); } return players; } In my case size of List<MediaPlayer> is 3. Than i use it there if (currentNumOfVideo == -1) { currentNumOfVideo