MediaStreamSource.Closed 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
發生于 MediaStreamSource 正在關閉時。
// Register
event_token Closed(TypedEventHandler<MediaStreamSource, MediaStreamSourceClosedEventArgs const&> const& handler) const;
// Revoke with event_token
void Closed(event_token const* cookie) const;
// Revoke with event_revoker
MediaStreamSource::Closed_revoker Closed(auto_revoke_t, TypedEventHandler<MediaStreamSource, MediaStreamSourceClosedEventArgs const&> const& handler) const;
public event TypedEventHandler<MediaStreamSource,MediaStreamSourceClosedEventArgs> Closed;
function onClosed(eventArgs) { /* Your code */ }
mediaStreamSource.addEventListener("closed", onClosed);
mediaStreamSource.removeEventListener("closed", onClosed);
- or -
mediaStreamSource.onclosed = onClosed;
Public Custom Event Closed As TypedEventHandler(Of MediaStreamSource, MediaStreamSourceClosedEventArgs)
事件類型
備註
如果MediaStreamSource因錯誤而關閉,MediaStreamSourceClosedRequest物件上的Reason屬性可從MediaStreamSourceClosedEventArgs取得,可提供錯誤本質的相關資訊。
收到此事件時,應用程式應該從 MediaStreamSource 物件中移除其所有事件處理常式,並避免進一步使用此 MediaStreamSource 物件的實例。
應用程式不需要有這個事件的處理常式。