MediaCapture.CaptureDeviceExclusiveControlStatusChanged Kejadian

Definisi

Terjadi ketika status kontrol eksklusif perangkat tangkapan berubah.

// 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) 

Jenis Acara

Persyaratan Windows

Rangkaian perangkat
Windows 10 Creators Update (diperkenalkan dalam 10.0.15063.0)
API contract
Windows.Foundation.UniversalApiContract (diperkenalkan dalam v4.0)
Kemampuan aplikasi
backgroundMediaRecording

Keterangan

Saat aplikasi memiliki kontrol eksklusif atas perangkat tangkapan, aplikasi dapat memodifikasi pengaturan perangkat. Aplikasi yang tidak memiliki kontrol eksklusif terhadap perangkat pengambilan masih dapat mengambil media, tetapi tidak dapat mengubah pengaturan pengambilan. Minta kontrol eksklusif dengan mengatur properti MediaCaptureInitializationSettings.SharingMode ke ExclusiveControl sebelum meneruskan struktur ke InitializeAsync. Panggilan ke InitializeAsync akan gagal jika Anda meminta kontrol eksklusif ketika aplikasi lain sudah memiliki akses eksklusif ke perangkat. Dalam hal ini, Anda dapat mendengarkan CaptureDeviceExclusiveControlStatusChanged, dan jika nilai MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status adalah ExclusiveControlAvailable, maka Anda dapat mencoba menginisialisasi ulang MediaCapture dengan kontrol eksklusif.

Jika peristiwa CaptureDeviceExclusiveControlStatusChanged dinaikkan dan nilai MediaCaptureDeviceExclusiveControlStatusChangedEventArgs.Status adalah SharedReadOnlyAvailable, maka aplikasi lain telah memperoleh kontrol eksklusif perangkat. Dalam hal ini, Anda mungkin ingin memperbarui UI untuk memberi tahu pengguna bahwa aplikasi lain dapat menyesuaikan pengaturan perangkat pengambilan.

Berlaku untuk