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.video.getWidth());
36 System.out.print("x");
37 System.out.println(jvlc.video.getHeight());
38 } catch (VLCException e) {
45 System.out.print("Fullscreen... ");
46 jvlc.video.setFullscreen(true);
48 System.out.println("real size.");
49 jvlc.video.setFullscreen(false);
50 System.out.print("Taking snapshot... ");
51 jvlc.video.getSnapshot( System.getProperty( "user.dir" ) + "/snap.png");
52 System.out.println("taken. (see " + System.getProperty( "user.dir" ) + "/snap.png )");
54 System.out.println("Resizing to 300x300");
55 jvlc.video.setSize(300, 300);
58 System.out.print("Muting...");
59 jvlc.audio.setMute(true);
61 System.out.println("unmuting.");
62 jvlc.audio.setMute(false);
64 System.out.println("Volume is: " + jvlc.audio.getVolume());
65 System.out.print("Setting volume to 150... ");
66 jvlc.audio.setVolume(150);
67 System.out.println("done");
69 System.out.println("INPUT INFORMATION");
70 System.out.println("-----------------");
71 System.out.println("Total length (ms) :\t" + jvlc.input.getLength());
72 System.out.println("Input time (ms) :\t" + jvlc.input.getTime());
73 System.out.println("Input position [0-1]:\t" + jvlc.input.getPosition());
75 System.out.println("Input FPS :\t" + jvlc.input.getFPS());
82 System.out.println("Something was wrong. I die :(.");
86 System.out.println("Everything fine ;)");
87 System.out.println("Playing next item");
90 } catch (VLCException e) {
96 } catch (InterruptedException e) {