Exemplo n.º 1
0
        // This will autostart the video when a video device becomes available and swicth it ON/OFF
        // on subsequent calls.
        public void ToggleVideo()
        {
            if (isRunning)
            {
                video.Stop();
                renderer.Stop();
                isRunning = false;
                return;
            }

            isRunning = true;

            // no webcam
            if (videoDeviceSelector.Items.Count == 0) return;

            VideoDevice device = (VideoDevice)videoDeviceSelector.SelectedItem;

            // This retrieves a video object for testing local webcam.
            // Unlike normal video objects, this one does not take place in context of a conversation.
            video = skype.CreatePreviewVideo(SktVideo.MEDIATYPE.MEDIA_VIDEO, device.name, device.path);

            // Associating the video object with renderer and starting both.
            renderer.VideoObject = video;

            video.Start();
            renderer.Start();
        }