Share via


MediaCapture.CaptureDeviceExclusiveControlStatusChanged Evento

Definición

Se produce cuando cambia el estado de control exclusivo del dispositivo de captura.

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

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

// Revoke with event_revoker
MediaCapture::CaptureDeviceExclusiveControlStatusChanged_revoker CaptureDeviceExclusiveControlStatusChanged(auto_revoke_t, TypedEventHandler<MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<MediaCapture,MediaCaptureDeviceExclusiveControlStatusChangedEventArgs> CaptureDeviceExclusiveControlStatusChanged;
function onCaptureDeviceExclusiveControlStatusChanged(eventArgs) { /* Your code */ }
mediaCapture.addEventListener("capturedeviceexclusivecontrolstatuschanged", onCaptureDeviceExclusiveControlStatusChanged);
mediaCapture.removeEventListener("capturedeviceexclusivecontrolstatuschanged", onCaptureDeviceExclusiveControlStatusChanged);
- or -
mediaCapture.oncapturedeviceexclusivecontrolstatuschanged = onCaptureDeviceExclusiveControlStatusChanged;
Public Custom Event CaptureDeviceExclusiveControlStatusChanged As TypedEventHandler(Of MediaCapture, MediaCaptureDeviceExclusiveControlStatusChangedEventArgs) 

Tipo de evento

Requisitos de Windows

Familia de dispositivos
Windows 10 Creators Update (se introdujo en la versión 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (se introdujo en la versión v4.0)
Características de aplicaciones
backgroundMediaRecording

Comentarios

Cuando una aplicación tiene control exclusivo del dispositivo de captura, puede modificar la configuración del dispositivo. Una aplicación que no tiene control exclusivo del dispositivo de captura puede seguir capturando medios, pero no puede cambiar la configuración de captura. Solicite control exclusivo estableciendo la propiedad MediaCaptureInitializationSettings.SharingMode en ExclusiveControl antes de pasar la estructura a InitializeAsync. Se producirá un error en la llamada a InitializeAsync si solicitas control exclusivo cuando otra aplicación ya tenga acceso exclusivo al dispositivo. En este caso, puede escuchar CaptureDeviceExclusiveControlStatusChanged y, si el valor de MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status es ExclusiveControlAvailable, puede intentar reinicializar mediaCapture con control exclusivo.

Si se genera el evento CaptureDeviceExclusiveControlStatusChanged y el valor de MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status es SharedReadOnlyAvailable, otra aplicación ha adquirido control exclusivo del dispositivo. En este caso, es posible que quiera actualizar la interfaz de usuario para alertar al usuario de que otra aplicación puede ajustar la configuración del dispositivo de captura.

Se aplica a