共用方式為


MediaPlayer.VideoFrameAvailable 事件

定義

IsVideoFrameServerEnabled 設定為 true 且新的視訊畫面可供處理時發生。

// Register
event_token VideoFrameAvailable(TypedEventHandler<MediaPlayer, IInspectable const&> const& handler) const;

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

// Revoke with event_revoker
MediaPlayer::VideoFrameAvailable_revoker VideoFrameAvailable(auto_revoke_t, TypedEventHandler<MediaPlayer, IInspectable const&> const& handler) const;
public event TypedEventHandler<MediaPlayer,object> VideoFrameAvailable;
function onVideoFrameAvailable(eventArgs) { /* Your code */ }
mediaPlayer.addEventListener("videoframeavailable", onVideoFrameAvailable);
mediaPlayer.removeEventListener("videoframeavailable", onVideoFrameAvailable);
- or -
mediaPlayer.onvideoframeavailable = onVideoFrameAvailable;
Public Custom Event VideoFrameAvailable As TypedEventHandler(Of MediaPlayer, Object) 

事件類型

Windows 需求

裝置系列
Windows 10 Creators Update (已於 10.0.15063.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v4.0 引進)

備註

在此事件的處理常式中,呼叫 CopyFrameToVideoSurface 以取得視訊畫面資料。

適用於