Bagikan melalui


CaptureDeviceConfiguration.GetDefaultVideoCaptureDevice Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Returns the VideoCaptureDevice object that represent the default video capture devices on the client system.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Shared Function GetDefaultVideoCaptureDevice As VideoCaptureDevice
public static VideoCaptureDevice GetDefaultVideoCaptureDevice()

Return Value

Type: System.Windows.Media.VideoCaptureDevice
The VideoCaptureDevice object that represent the default video capture devices on the client system.

On Mac OSX, if an application calls GetDefaultAudioCaptureDevice or GetDefaultVideoCaptureDevice and the default audio and video devices have not previously been set by the user, Silverlight will return the first device found. If a physical device is not connected to this CaptureDevice, an InvalidOperationException will be thrown when Start is called. This expectation should be caught by the application and the user can then be notified to manually set their default devices in the "Webcam/Mic" section of the Configuration Settings dialog.

Version Information

Silverlight

Supported in: 5, 4

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.