1 import org.videolan.jvlc.AudioIntf;
2 import org.videolan.jvlc.JVLC;
3 import org.videolan.jvlc.VLCException;
6 public class VLCExample
9 public static void main( String[] args )
11 boolean videoInput = false;
12 JVLC jvlc = new JVLC(args);
14 //jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.avi", "a.avi");
15 jvlc.playlist.add("file:///home/little/a.avi", "a.avi");
16 jvlc.playlist.add("file://" + System.getProperty( "user.dir" ) + "/a.mp3", "a.mp3");
17 jvlc.playlist.play( -1 , null );
18 } catch (VLCException e) {
21 while (! jvlc.isInputPlaying()) ;
22 while (! jvlc.hasVout() );
26 // testing vout functionalities
30 if (jvlc.hasVout()) videoInput = true;
31 } catch (InterruptedException e) {
37 System.out.print(jvlc.video.getWidth());
38 System.out.print("x");
39 System.out.println(jvlc.video.getHeight());
40 } catch (VLCException e) {
47 System.out.print("Fullscreen... ");
48 jvlc.video.setFullscreen(true);
50 System.out.println("real size.");
51 jvlc.video.setFullscreen(false);
52 System.out.print("Taking snapshot... ");
53 jvlc.video.getSnapshot( System.getProperty( "user.dir" ) + "/snap.png");
54 System.out.println("taken. (see " + System.getProperty( "user.dir" ) + "/snap.png )");
56 System.out.println("Resizing to 300x300");
57 jvlc.video.setSize(300, 300);
60 System.out.print("Muting...");
61 jvlc.audio.setMute(true);
63 System.out.println("unmuting.");
64 jvlc.audio.setMute(false);
66 System.out.println("Volume is: " + jvlc.audio.getVolume());
67 System.out.print("Setting volume to 150... ");
68 jvlc.audio.setVolume(150);
69 System.out.println("done");
70 System.out.println("Audio channel info: " + jvlc.audio.getChannel());
71 System.out.println("Audio track info: " + jvlc.audio.getTrack());
72 System.out.print("Setting left channel... ");
73 jvlc.audio.setChannel("left");
74 System.out.print("done.");
76 System.out.print("Setting right channel... ");
77 jvlc.audio.setChannel(AudioIntf.RIGHT_CHANNEL);
78 System.out.print("done.");
80 System.out.println("INPUT INFORMATION");
81 System.out.println("-----------------");
82 System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
83 System.out.println("Input time (ms) :\t" + jvlc.input.getTime());
84 System.out.println("Input position [0-1]:\t" + jvlc.input.getPosition());
86 System.out.println("Input FPS :\t" + jvlc.input.getFPS());
93 System.out.println("Something was wrong. I die :(.");
99 System.out.println("Everything fine ;)");
100 System.out.println("Playing next item");
102 jvlc.playlist.next();
103 } catch (VLCException e) {
109 } catch (InterruptedException e) {