Silverlight 4 support for audio capture devices and video capture devices (Webcam), has opened up a new range of possibilities like audio/video recording, snapshots etc. You can also use the Webcam feature for Video conferencing but since there is limited support for compression and encoding available out-of-the-box, it is not yet a very viable solution for conferencing. In this short article, we will see how simple it is to use a Webcam in Silverlight 4.
Silverlight automatically recognizes the video and audio capture devices on your machine. If you want to explicitly list the audio and video devices for the end user to choose from, read my blogpost Silverlight 4: List Audio and Video Devices
Follow these steps:
Step 1: Create a new Silverlight 4 application and call it ‘SilverlightWebCam’.
Step 2: In the MainPage.xaml, add the following controls:
Step 3: In the code behind, create a CaptureSource object as a member field, so that it is available for all events. The CaptureSource class is an important class that provides methods that work with specific audio or video captures from the associated capture device.
private CaptureSource _cs = null;
Now create the event handlers for the Start and Stop button
Step 4: In the btnStartWebcam event handler, we are making a call to the StartWebCam() method. Let us code this method, as shown below:
Read more: net Curry
0 comments:
Post a Comment