// ControllerListener implementation public void controllerUpdate(ControllerEvent e) { System.out.println(e.getClass().getName()); if (e instanceof EndOfMediaEvent) { playingDialog.setVisible(false); System.exit(0); } }
/** Controller Listener. This is taken from Sun's examples. */ public void controllerUpdate(ControllerEvent evt) { System.err.println("Listener called"); if (evt instanceof ConfigureCompleteEvent || evt instanceof RealizeCompleteEvent || evt instanceof PrefetchCompleteEvent || evt instanceof StartEvent || evt instanceof StopEvent) { // synchronized (waitSync) { synchronized (this) { stateTransitionOK = true; // waitSync.notifyAll(); this.notifyAll(); } } else if (evt instanceof ControllerClosedEvent) { // synchronized (waitSync) { synchronized (this) { stateTransitionOK = false; // waitSync.notifyAll(); this.notifyAll(); } } else System.err.println(" Event raised was " + evt.getClass()); }