public void commandAction(Command c, Displayable d) { if (c == CMD_EXIT) { parentMidlet.destroyApp(true); parentMidlet.notifyDestroyed(); } else if (c == CMD_RECORD) { videoRecordThread = new VideoRecordingThread(); videoRecordThread.start(); } }
private void showCamera() { try { releaseResources(); player = Manager.createPlayer("capture://video"); player.addPlayerListener(this); player.realize(); videoControl = (VideoControl) player.getControl("VideoControl"); aVideoCanvas = new VideoCanvas(); aVideoCanvas.initControls(videoControl, player); aVideoCanvas.addCommand(CMD_RECORD); aVideoCanvas.addCommand(CMD_EXIT); aVideoCanvas.setCommandListener(this); parentMidlet.getDisplay().setCurrent(aVideoCanvas); player.start(); contentType = player.getContentType(); } catch (Exception e) { e.printStackTrace(); } }