I need play movie in JME. I use jme to load the movie and add it to JMEDesktop, but I can not see pictures in JMEDesktop.Can JME support playing movie now?
here is the code:
the movie panel
public class MoviePanel extends JPanel implements ControllerListener
{
private Component vc, cc;
private Player player;
private boolean loop;
private Dimension size;
public MoviePanel()
{
super();
loop = true;
size = new Dimension(300,300);
initFlim();
}
public void controllerUpdate(ControllerEvent e)
{
if (e instanceof ControllerClosedEvent) {
if (vc != null) {
remove(vc);
vc = null;
}
if (cc != null) {
remove(cc);
cc = null;
}
return;
}
if (e instanceof EndOfMediaEvent) {
if (loop) {
player.setMediaTime(new Time(0));
player.start();
}
//player.close();
return;
}
if (e instanceof PrefetchCompleteEvent) {
player.start();
return;
}
if (e instanceof RealizeCompleteEvent) {
this.setSize(size);
this.setLayout(new BorderLayout());
vc = player.getVisualComponent();
vc.setSize(size);
//vc.addMouseListener(this);
if (vc != null){
this.add(vc,BorderLayout.CENTER);
}
//add(vc,BorderLayout.CENTER);
cc = player.getControlPanelComponent();
if (cc != null){
this.add(cc, BorderLayout.NORTH);
}
//this.add(panelFilm);
//add(panelFilm,BorderLayout.CENTER);
//this.pack();
//this.lwjglp.repaint();
}
}
public void initFlim(){