* Argument should be a media url or file argument
*
* @param args[]
*/
public static void main(String args[]) {
Player player;
if( args.length != 1 ) {
System.err.println("Usage:");
System.err.println("java ejmf.examples.basics.HelloWorld <Media>");
return;
}
String media = args[0];
JFrame f = new JFrame(media);
// Allow window to close
f.addWindowListener(
new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
JPanel playerpanel = new JPanel();
try {
URL url = new URL("file://" + new File(media).getCanonicalPath());
player = Manager.createRealizedPlayer(url);
f.getContentPane().add(playerpanel);
f.pack();
f.setVisible(true);
player.start();
}
catch (MalformedURLException mfe) {
System.out.println("Bad URL");
}
catch (IOException ioe) {