public void stop() throws MediaException {
        //System.out.println("MMPlayer stop called");
        if(state == CLOSED) throw new IllegalStateException();
        if(state != STARTED) return;
        try{
        	stopImpl();
        	ApplicationManager.manager.activePlayers.removeElement(this);
        }
        catch(Exception e){
        	e.printStackTrace();
        	throw new MediaException(e.toString());
        }
        state = PREFETCHED;
        if(autoNotify){
        	startListenerNotification(PlayerListener.STOPPED, null);
        }
    }