src/net/java/sip/communicator/impl/neomedia/MediaConfigurationImpl.java
/**
     * Creates preview for the (video) device in the video container.
     *
     * @param device the device
     * @param videoContainer the video container
     * @throws IOException a problem accessing the device
     * @throws MediaException a problem getting preview
     */
Creates preview for the (video) device in the video container.
@param device the device
@param videoContainer the video container
@throws IOException a problem accessing the device
@throws MediaException a problem getting preview
Creates preview for the ( video ) device in the video container . @param device the device @param videoContainer the video container @throws IOException a problem accessing the device @throws MediaException a problem getting preview
private static void createVideoPreview(
            CaptureDeviceInfo device,
            JComponent videoContainer)
        throws IOException,
               MediaException
    {
        videoContainer.removeAll();
        videoContainer.revalidate();
        videoContainer.repaint();
        if (device == null)
            return;
        for (MediaDevice mediaDevice
                : mediaService.getDevices(MediaType.VIDEO, MediaUseCase.ANY))
        {
            if(((MediaDeviceImpl) mediaDevice).getCaptureDeviceInfo().equals(
                    device))
            {
                Dimension videoContainerSize
                    = videoContainer.getPreferredSize();
                Component preview
                    = (Component)
                        mediaService.getVideoPreviewComponent(
                                mediaDevice,
                                videoContainerSize.width,
                                videoContainerSize.height);
                if (preview != null)
                    videoContainer.add(preview);
                break;
            }
        }
    }
private static void createVideoPreview ( CaptureDeviceInfo device , JComponent videoContainer ) throws IOException , MediaException { videoContainer . removeAll ( ) ; videoContainer . revalidate ( ) ; videoContainer . repaint ( ) ; if ( device == null ) return ; for ( MediaDevice mediaDevice : mediaService . getDevices ( MediaType . VIDEO , MediaUseCase . ANY ) ) { if ( ( ( MediaDeviceImpl ) mediaDevice ) . getCaptureDeviceInfo ( ) . equals ( device ) ) { Dimension videoContainerSize = videoContainer . getPreferredSize ( ) ; Component preview = ( Component ) mediaService . getVideoPreviewComponent ( mediaDevice , videoContainerSize . width , videoContainerSize . height ) ; if ( preview != null ) videoContainer . add ( preview ) ; break ; } } }
Creates preview for the (video) device in the video container.
Creates preview for the ( video ) device in the video container .