MediaCapture.CaptureDeviceExclusiveControlStatusChanged MediaCapture.CaptureDeviceExclusiveControlStatusChanged MediaCapture.CaptureDeviceExclusiveControlStatusChanged MediaCapture.CaptureDeviceExclusiveControlStatusChanged MediaCapture.CaptureDeviceExclusiveControlStatusChanged Event

Definition

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

public : event TypedEventHandler<MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> CaptureDeviceExclusiveControlStatusChanged
// Register
event_token CaptureDeviceExclusiveControlStatusChanged(TypedEventHandler<MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> const& handler) const;

// Revoke with event_token
void CaptureDeviceExclusiveControlStatusChanged(event_token const& cookie) const;

// Revoke with event_revoker
CaptureDeviceExclusiveControlStatusChanged_revoker CaptureDeviceExclusiveControlStatusChanged(auto_revoke_t, TypedEventHandler<MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> const& handler) const;
public event TypedEventHandler<MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> CaptureDeviceExclusiveControlStatusChanged
Public Event CaptureDeviceExclusiveControlStatusChanged As TypedEventHandler (Of MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs)
function onCaptureDeviceExclusiveControlStatusChanged(eventArgs){/* Your code */}


mediaCapture.addEventListener("capturedeviceexclusivecontrolstatuschanged", onCaptureDeviceExclusiveControlStatusChanged);
mediaCapture.removeEventListener("capturedeviceexclusivecontrolstatuschanged", onCaptureDeviceExclusiveControlStatusChanged);

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.