112113114115116117118119120121122
@Override public void actionPerformed(ActionEvent e) { currentIndex ++ ; if(currentIndex < files.size()) { mediaPlayer.playMedia(files.get(currentIndex).getAbsolutePath()); } } }); p.getInputMap().put(KeyStroke.getKeyStroke("SPACE"), "next");
124125126127128129130131132133134
if(files.isEmpty()) { System.out.println("No media files found"); System.exit(1); } mediaPlayer.playMedia(files.get(0).getAbsolutePath()); } private static List<File> scan(File root) { List<File> result = new ArrayList<File>(200); scan(root, result);
6970717273747576777879
List<File> files = scanMedia(new File("/movies")); Thread.sleep(3000); for(File file : files) { mediaPlayer.playMedia(file.getAbsolutePath()); Thread.sleep(500); mediaPlayer.setChapter(4); Thread.sleep(2000); }
126127128129130131132133134135136
}); mediaPlayer.setOverlay(new Overlay(f)); mediaPlayer.enableOverlay(true); mediaPlayer.playMedia(mrl); LibXUtil.setFullScreenWindow(f, true); } private class Overlay extends Window {
6566676869707172737475
f.add(canvas); f.setSize(800, 600); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); mediaPlayer.playMedia(media, options, ":no-sout-rtp-sap", ":no-sout-standard-sap", ":sout-all", ":sout-keep"