共用方式為


MediaStreamSource.Closed 事件

定義

發生于 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 物件的實例。

應用程式不需要有這個事件的處理常式。

適用於

另請參閱