public void controllerUpdate(ControllerEvent ce) {
	if (ce instanceof RealizeCompleteEvent) {
	    mplayer.prefetch();
	} else if (ce instanceof PrefetchCompleteEvent) {
	    if (visual != null)
		return;
	    
	    if ((visual = mplayer.getVisualComponent()) != null) {
		Dimension size = visual.getPreferredSize();
		videoWidth = size.width;
		videoHeight = size.height;
		getContentPane().add("Center", visual);
	    } else
		videoWidth = 320;
	    if ((control = mplayer.getControlPanelComponent()) != null) {
		controlHeight = control.getPreferredSize().height;
		getContentPane().add("South", control);
	    }
	    setSize(videoWidth + insetWidth,
		    videoHeight + controlHeight + insetHeight);
	    validate();
	    
	    //Format[] inFormats = { new VideoFormat (VideoFormat.MPEG) };

//	    String JFFMPEG_VIDEO = "net.sourceforge.jffmpeg.VideoDecoder";
//	    Codec video=null;
//		try {
//			video = (Codec) Class.forName(JFFMPEG_VIDEO).newInstance();
//		} catch (InstantiationException | IllegalAccessException  |	ClassNotFoundException e) {
//			e.printStackTrace();
//		}		
//	    PlugInManager.addPlugIn (JFFMPEG_VIDEO, 
//	    		video.getSupportedInputFormats(),
//	    		video.getSupportedOutputFormats(null), 
//	    		PlugInManager.CODEC);
//	    	   
	            
	    PlugInManager.addPlugIn("com.sun.media.codec.video.jpeg.Packetizer", 
	    		new Format[] {
	    			new VideoFormat("jpeg", null,  -1, Format.byteArray, -1.0f),
	    		}, 
	    		new Format[] {
	    			new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
	    		}, 
	    		PlugInManager.CODEC);
	    PlugInManager.addPlugIn("com.sun.media.codec.video.jpeg.DePacketizer", 
	    		new Format[] {
	    			new VideoFormat("jpeg/rtp", null, -1, Format.byteArray, -1.0f),
	    		}, 
	    		new Format[] {
	    			new VideoFormat("jpeg", null, -1, Format.byteArray, -1.0f),
	    		}, 
	    		PlugInManager.CODEC);
	    PlugInManager.addPlugIn("com.sun.media.renderer.video.JPEGRenderer", 
	    		new Format[] {
	    			new VideoFormat("jpeg", null, -1, Format.byteArray, -1.0f),
	    	}, 	
	    	new Format[] {}, 
	    		PlugInManager.RENDERER);
	    
	    
	    
	    
	    try {
			PlugInManager.commit ();
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
	    	
	    	
        Set<String> registeredPlugins1 = new HashSet<String>();
        registeredPlugins1.addAll(PlugInManager.getPlugInList(null, null, PlugInManager.CODEC));
         for (String string : registeredPlugins1) {
        	 //if(string.toLowerCase().contains("mov"))
                       System.out.println("registeredPlugins1 : " + string);
          }
        
	    
	    
	    mplayer.start();
	} else if (ce instanceof EndOfMediaEvent) {
	    mplayer.setMediaTime(new Time(0));
	    mplayer.start();
	}
    }