/** * Creates preview for the device(video) in the video container. * * @param device the device * @param videoContainer the container * @throws IOException a problem accessing the device. * @throws MediaException a problem getting preview. */ private static void createPreview(MediaDevice device, final JComponent videoContainer) throws IOException, MediaException { videoContainer.removeAll(); videoContainer.revalidate(); videoContainer.repaint(); if (device == null) return; Component c = (Component) GuiActivator.getMediaService() .getVideoPreviewComponent( device, videoContainer.getSize().width, videoContainer.getSize().height); videoContainer.add(c); }
/** * Volume control used by the button. * * @return volume control used by the button. */ private VolumeControl getVolumeControl() { VolumeControl volumeControl = GuiActivator.getMediaService().getInputVolumeControl(); volumeControl.addVolumeChangeListener(this); return volumeControl; }