Find below the vlcj player embedding inside the eclipse plugin. It takes only few lines to get it embedded. The videocomposite below created should always be SWT.EMBEDDED, otherwise, it may give "Invalid Arugument" Error. For compiling and running add vlcj library and its dependecies JNA.jar and platform.jar libraries to the project. These libraries can be donwloaded from below reference.
/*VLC Player*/
org.eclipse.swt.widgets.Composite videoComposite = new org.eclipse.swt.widgets.Composite(parent, SWT.EMBEDDED | SWT.NO_BACKGROUND);
java.awt.Frame videoFrame = SWT_AWT.new_Frame(videoComposite);
java.awt.Canvas playerCanvas = new java.awt.Canvas();
playerCanvas.setBackground(java.awt.Color.black);
videoFrame.add(playerCanvas);
MediaPlayerFactory mpFactory = new MediaPlayerFactory();
EmbeddedMediaPlayer vlcPlayer = mpFactory.newMediaPlayer(null);
videoComposite.setBounds(5,5, 560,244);
videoComposite.setVisible(true);
ePlayer.setVideoSurface(playerCanvas);
/*end */
Additional reference
Java bindings for vlc media player
http://code.google.com/p/vlcj
http://code.google.com/p/vlcj/wiki/SwtExample
vlcj sources can be downloaded from
http://www.capricasoftware.co.uk/vlcj/downloads.php
vlcj tutorial
http://www.capricasoftware.co.uk/vlcj/tutorial.php
No comments:
Post a Comment