Ho trovato un codice e l'ho implementato, solo che adesso non appena vado ad esportare il progetto il video nn lo vede e rimane lo schermo nero, invece in locale va tutto bene, non capisco perchè cavolo ..vi posto i codici se riuscite a darmi una spiegazione grazie e se pure a voi fa cosi!
/////classe main
package VideoVLCJ;
import uk.co.caprica.vlcj.discovery.NativeDiscovery;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.NativeLibrary;
public class main {
private static String cheminvlc = "C:/Program Files/VideoLAN/VLC";
public static void main(String[] args) {
new NativeDiscovery().discover();
NativeLibrary.addSearchPath
(RuntimeUtil.getLibVlcLibraryName(),cheminvlc);
System.setProperty("jna.library.path",cheminvlc);
finestra f = new finestra();
}
}
///////////classe2
package VideoVLCJ;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;
public class lettura extends JPanel {
private EmbeddedMediaPlayerComponent mediaPlayer;
private String cheminVideo = "src/videoVLCJ/Parco.wmv";
final static int vol=120;
public lettura() {
mediaPlayer = new EmbeddedMediaPlayerComponent();
this.setLayout(new BorderLayout());
this.add(mediaPlayer,BorderLayout.CENTER);
}
public void play(){
mediaPlayer.getMediaPlayer().playMedia(cheminVideo);
}
public void pausa(){
mediaPlayer.getMediaPlayer().pause();
}
public void stop(){
mediaPlayer.getMediaPlayer().stop();
}
public void ricomincia(){
mediaPlayer.getMediaPlayer().start();
}
}
///classe 3
package VideoVLCJ;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
public class finestra extends JFrame {
private JPanel main = new JPanel();
private lettura media = new lettura();
private final JButton btnGenerale = new JButton("Play");
private final JButton btnP = new JButton("Pausa");
public finestra() {
setTitle("eee");
setDefaultCloseOperation(EXIT_ON_CLOSE);
setSize(500,500);
setVisible(true);
setContentPane(main);
main.setLayout(null);
main.add(media);
media.setBounds(0, 0,500, 300);
btnGenerale.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(btnGenerale.getText().equals("Play")){
media.play();
btnGenerale.setText("Stop");
return;
}
media.stop();
btnGenerale.setText("Play");
}
});
btnGenerale.setBounds(10, 353, 89, 23);
main.add(btnGenerale);
btnP.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(btnP.getText().equals("Pausa")){
media.pausa();
btnP.setText("Play");
return;
}
media.pausa();
btnP.setText("Pausa");
}
});
btnP.setBounds(109, 353, 106, 23);
main.add(btnP);
}
}
bisogna importare queste librerie e vlc istallato
https://code.google.com/p/vlcj/downloads/detail?name=vlcj-2.4.1-dist.zip&can=2&q=