MFP_EVENT_TYPE enumeration
Defines event types for the IMFPMediaPlayerCallback interface.
Syntax
typedef enum MFP_EVENT_TYPE { MFP_EVENT_TYPE_PLAY = 0, MFP_EVENT_TYPE_PAUSE = 1, MFP_EVENT_TYPE_STOP = 2, MFP_EVENT_TYPE_POSITION_SET = 3, MFP_EVENT_TYPE_RATE_SET = 4, MFP_EVENT_TYPE_MEDIAITEM_CREATED = 5, MFP_EVENT_TYPE_MEDIAITEM_SET = 6, MFP_EVENT_TYPE_FRAME_STEP = 7, MFP_EVENT_TYPE_MEDIAITEM_CLEARED = 8, MFP_EVENT_TYPE_MF = 9, MFP_EVENT_TYPE_ERROR = 10, MFP_EVENT_TYPE_PLAYBACK_ENDED = 11, MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL = 12 } MFP_EVENT_TYPE;
Constants
- MFP_EVENT_TYPE_PLAY
-
Playback has started. This event is sent when the IMFPMediaPlayer::Play method completes.
- MFP_EVENT_TYPE_PAUSE
-
Playback has paused. This event is sent when the IMFPMediaPlayer::Pause method completes.
- MFP_EVENT_TYPE_STOP
-
Playback has stopped. This event is sent when the IMFPMediaPlayer::Stop method completes.
- MFP_EVENT_TYPE_POSITION_SET
-
The MFPlay player object has seeked to a new playback position. This event is sent when the IMFPMediaPlayer::SetPosition method completes.
- MFP_EVENT_TYPE_RATE_SET
-
The playback rate has changed. This event is sent when the IMFPMediaPlayer::SetRate method completes.
- MFP_EVENT_TYPE_MEDIAITEM_CREATED
-
A new media item was created. This event is sent when the IMFPMediaPlayer::CreateMediaItemFromURL or CreateMediaItemFromObject method completes.
- MFP_EVENT_TYPE_MEDIAITEM_SET
-
A media item is ready for playback. This event is sent when the IMFPMediaPlayer::SetMediaItem method completes.
- MFP_EVENT_TYPE_FRAME_STEP
-
A frame-step operation has completed. This event is sent when the IMFPMediaPlayer::FrameStep method completes.
- MFP_EVENT_TYPE_MEDIAITEM_CLEARED
-
The current media item was cleared. This event is sent when the IMFPMediaPlayer::ClearMediaItem method completes.
- MFP_EVENT_TYPE_MF
-
A pipeline object sent an event. The player object forwards certain pipeline events to the application. For more information, see MFP_MF_EVENT.
- MFP_EVENT_TYPE_ERROR
-
A playback error has occurred.
- MFP_EVENT_TYPE_PLAYBACK_ENDED
-
Playback has ended. The player object sends this event when playback reaches the end of the media file.
- MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL
-
The media source requires authentication before it can play the file.
Remarks
For each event type, the IMFPMediaPlayerCallback::OnMediaPlayerEvent callback receives a pointer to a data structure. The first part of the data structure is always an MFP_EVENT_HEADER structure. The following table lists the data structure for each event type.
In your implementation of OnMediaPlayerEvent, you must cast the pEventHeader parameter to the correct structure type. A set of macros is defined for this purpose. These macros check the value of the event type and return NULL if there is a mismatch; otherwise they return a pointer to the correct structure type.
| Event type |
Event structure Pointer cast macro |
| MFP_EVENT_TYPE_PLAY | |
| MFP_EVENT_TYPE_PAUSE | |
| MFP_EVENT_TYPE_STOP | |
| MFP_EVENT_TYPE_POSITION_SET | |
| MFP_EVENT_TYPE_RATE_SET | |
| MFP_EVENT_TYPE_MEDIAITEM_CREATED | |
| MFP_EVENT_TYPE_MEDIAITEM_SET | |
| MFP_EVENT_TYPE_FRAME_STEP | |
| MFP_EVENT_TYPE_MEDIAITEM_CLEARED | |
| MFP_EVENT_TYPE_MF | |
| MFP_EVENT_TYPE_ERROR | |
| MFP_EVENT_TYPE_PLAYBACK_ENDED | |
| MFP_EVENT_TYPE_ACQUIRE_USER_CREDENTIAL |
Requirements
|
Minimum supported client |
Windows 7 [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 R2 [desktop apps only] |
|
Header |
|
See also