1 import org.videolan.jvlc.JVLC;
2 import org.videolan.jvlc.VLCException;
5 public class VLCExample
8 public static void main( String[] args )
10 boolean videoInput = false;
11 JVLC jvlc = new JVLC(args);
13 jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.avi", "a.avi");
14 jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.mp3", "a.mp3");
15 jvlc.playlist.play( -1 , null );
16 } catch (VLCException e) {
19 while (! jvlc.isInputPlaying()) ;
20 while (! jvlc.hasVout() );
24 // testing vout functionalities
28 if (jvlc.hasVout()) videoInput = true;
29 } catch (InterruptedException e) {
35 System.out.print(jvlc.getVideoWidth());
36 System.out.print("x");
37 System.out.println(jvlc.getVideoHeight());
38 } catch (VLCException e) {
45 System.out.print("Fullscreen... ");
46 jvlc.setFullscreen(true);
48 System.out.println("real size.");
49 jvlc.setFullscreen(false);
50 System.out.print("Taking snapshot... ");
51 jvlc.getSnapshot( System.getProperty( "user.dir" ) + "/snap.png");
52 System.out.println("taken. (see " + System.getProperty( "user.dir" ) + "/snap.png )");
54 System.out.print("Muting...");
57 System.out.println("unmuting.");
60 System.out.println("Volume is: " + jvlc.getVolume());
61 System.out.print("Setting volume to 150... ");
63 System.out.println("done");
65 System.out.println("INPUT INFORMATION");
66 System.out.println("-----------------");
67 System.out.println("Total length (ms) :\t" + jvlc.getInputLength());
68 System.out.println("Input time (ms) :\t" + jvlc.getInputTime());
69 System.out.println("Input position [0-1]:\t" + jvlc.getInputPosition());
71 System.out.println("Input FPS :\t" + jvlc.getInputFPS());
78 System.out.println("Something was wrong. I die :(.");
82 System.out.println("Everything fine ;)");
83 System.out.println("Playing next item");
86 } catch (VLCException e) {
92 } catch (InterruptedException e) {