locked
MediaCapture to start webcam RRS feed

  • Question

  • Hi everyone,

    I am new to Windows Store apps. I need to detect and start webcam using the app. The webcam I have is iball Face2Face C8.0. It is connected to the system and device manager detects it and shows the device is working properly. But when I try to access the webcam using the MediaCapture Api it takes me to camera page and says "connect a camera".

    Following is the code.

    private async void Button_Click(object sender, RoutedEventArgs e)
            {
                CameraCaptureUI obj = new CameraCaptureUI();
                obj.VideoSettings.Format = CameraCaptureUIVideoFormat.Mp4;
                StorageFile file =  await obj.CaptureFileAsync(CameraCaptureUIMode.Video);
                if(file!=null)
                {
                    IRandomAccessStream stream = await file.OpenAsync(FileAccessMode.Read);
                    myMedia.SetSource(stream, "video/mp4");
                }
            }

    Thank you,

    Yeou Sunn Liu


    Regards, Yeou Sunn Liu MCTS, MCITP.

    Sunday, January 19, 2014 5:48 PM

Answers

  • Hi Yeou Sunn Liu,

    To enable webcam access, the app must include the Webcam DeviceCapability in the application manifest.

    Here is a detail tutorial for you to go through the webcam issue: How to preview video from a webcam. Hope it helps.

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, January 20, 2014 9:29 AM
    Moderator