共用方式為


MediaCapture.CameraStreamStateChanged 事件

定義

發生于相機串流的狀態變更時。

// Register
event_token CameraStreamStateChanged(TypedEventHandler<MediaCapture, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
MediaCapture::CameraStreamStateChanged_revoker CameraStreamStateChanged(auto_revoke_t, TypedEventHandler<MediaCapture, IInspectable const&> const& handler) const;
public event TypedEventHandler<MediaCapture,object> CameraStreamStateChanged;
function onCameraStreamStateChanged(eventArgs) { /* Your code */ }
mediaCapture.addEventListener("camerastreamstatechanged", onCameraStreamStateChanged);
mediaCapture.removeEventListener("camerastreamstatechanged", onCameraStreamStateChanged);
- or -
mediaCapture.oncamerastreamstatechanged = onCameraStreamStateChanged;
Public Custom Event CameraStreamStateChanged As TypedEventHandler(Of MediaCapture, Object) 

事件類型

Windows 需求

應用程式功能
backgroundMediaRecording

備註

當錄製暫停或繼續、系統基於隱私權考慮卸載畫面格,或相機串流遺失時,相機串流的狀態將會變更。

適用於