Thank you so much for your prompt reply.
As you have suggested I have gone through the examples with vlcj.Finally got the solution.
Code: Select all
//Set Videosurface
Canvas canvas = new Canvas();
canvas.setBackground(Color.green);
CanvasVideoSurface videoSurface = mediaPlayerFactory.newVideoSurface(canvas);
EmbeddedMediaPlayer mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer();
mediaPlayer.setVideoSurface(videoSurface);
MediaListPlayer mediaListPlayer = mediaPlayerFactory.newMediaListPlayer();
String[] mediapath = new String[2];
mediapath[0] = "C:\\Users\\Public\\Videos\\Sample Videos\\Wildlife.wmv";
mediapath[1] = "C:\\Users\\Public\\Videos\\Sample Videos\\The International.mov";
cnt = 0;
while (cnt != mediapath.length) {
mediaList.addMedia(mediapath[cnt]);
cnt++;
}
mediaListPlayer.setMediaList(mediaList);
mediaListPlayer.setMode(MediaListPlayerMode.LOOP);
mediaListPlayer.play();
JPanel cp = new JPanel();
cp.setBackground(Color.black);
cp.setLayout(new BorderLayout());
cp.add(canvas, BorderLayout.CENTER);
JFrame f = new JFrame("vlcj embedded media list player test");
f.setSize(200, 700);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
Here , still I am not clear with implementation of setting video surface.Because when I want to set height and width to the video,which is getting played.So hence I am using the setbound proerty Canvas object (e.g. canvas.setBounds(0, 0, 400, 400);) It seems not getting apply.So how to set height and width to video ??? As per above specified code video is getting displayed as per jframe's width. But If I want to set height & width to video irrespective to size of jframe , then how to set ??? Please kindly guide me in this. If I am going somewhere wrong then please let me know .
Many Thanks,