MediaCapture.CaptureDeviceExclusiveControlStatusChanged Event

Definition

Occurs when the exclusive control status of the capture device changes.

C#
public event TypedEventHandler<MediaCapture,MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> CaptureDeviceExclusiveControlStatusChanged;

Event Type

Windows requirements

Device family
Windows 10 Creators Update (introduced in 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v4.0)
App capabilities
backgroundMediaRecording

Remarks

When an app has exclusive control of the capture device, it can modify the settings of the device. An app that does not have exclusive control of the capture device can still capture media, but it can't change the capture settings. Request exclusive control by setting the MediaCaptureInitializationSettings.SharingMode property to ExclusiveControl before passing the structure into InitializeAsync. The call to InitializeAsync will fail if you request exclusive control when another app already has exclusive access to the device. In this case, you can listen for CaptureDeviceExclusiveControlStatusChanged, and if the value of MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status is ExclusiveControlAvailable, then you can attempt to reinitialize the MediaCapture with exclusive control.

If the CaptureDeviceExclusiveControlStatusChanged event is raised and the value of MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status is SharedReadOnlyAvailable, then another app has acquired exclusive control of the device. In this case, you may want to update your UI to alert the user that another app may adjust the capture device settings.

Applies to

Product Versions
WinRT Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100