PlayList
Posted: 25 Mar 2009 11:50
I want to create e and play a playlist with jvlc library.I read the reference and i saw tha the class was deprecated;so i try to use :
MediaPlayer
MediaDescriptor
MediaPlayerListener
MediaList
MediaListPlayer
This is may code
The problem is :
If i use the method MediaListPlayer.play play only the first song! Why don't play all song that i set in MediaList?
can somebody help me ?
Thank you Gianpaolo
MediaPlayer
MediaDescriptor
MediaPlayerListener
MediaList
MediaListPlayer
This is may code
Code: Select all
public class VlcDemo {
public static void main(String[] args) throws InterruptedException {
String[] param = new String[] {
"-vvv",
//"--plugin-path=.\\3rd_party\\vlc-0.9.0-test3-20080727-0004\\plugins",
"--plugin-path=.\\vlc\\vlc-0.9.8a\\plugins",
"--no-plugins-cache"
};
//NativeLibrary.addSearchPath("libvlc", "C:\\Documents and Settings\\gianpaolot\\Desktop\\vlcinstaller\\vlc\\vlc-0.9.8a");
NativeLibrary.addSearchPath("libvlc", ".\\vlc\\vlc-0.9.8a");
JVLC jvlc = new JVLC(param);
MediaPlayer mp;
MediaDescriptor[] ds =new MediaDescriptor[2];
MediaPlayerListener mpl;
MediaList ml;
MediaListPlayer mlp;
ds[1] = new MediaDescriptor(jvlc, "c:\\caressa.mp3");
ds[0] =new MediaDescriptor(jvlc,"c:\\Gattino.mp3");
ml =new MediaList(jvlc);
for (int i = 0; i < ds.length; i++) {
ml.addMedia(ds[i]);
}
MediaListPlayer listPlayer=new MediaListPlayer(jvlc);
listPlayer.setMediaList(ml);
listPlayer.play();
Thread.sleep(1000000); // Sleep for 10 seconds to let the movie play for a bit.
}
}
If i use the method MediaListPlayer.play play only the first song! Why don't play all song that i set in MediaList?
can somebody help me ?
Thank you Gianpaolo