CurrentMediaItemAvailable Event of the AxWindowsMediaPlayer Object
[The feature associated with this page, Windows Media Player SDK, is a legacy feature. It has been superseded by MediaPlayer. MediaPlayer has been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer instead of Windows Media Player SDK, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]
The CurrentMediaItemAvailable event occurs when a graphic metadata item in the current media item becomes available.
[C#]
private void player_CurrentMediaItemAvailable(
object sender,
_WMPOCXEvents_CurrentMediaItemAvailableEvent e
)
[Visual Basic]
Private Sub player_CurrentMediaItemAvailable(
sender As Object,
e As _WMPOCXEvents_CurrentMediaItemAvailableEvent
) Handles player.CurrentMediaItemAvailable
Event Data
The handler associated with this event is of type AxWMPLib._WMPOCXEvents_CurrentMediaItemAvailableEventHandler. This handler receives an argument of type AxWMPLib._WMPOCXEvents_CurrentMediaItemAvailableEvent, which contains the following property related to this event.
Property | Description |
---|---|
bstrItemName | System.StringThe name of the current media item. |
Remarks
Because playback can begin before a media item is fully downloaded, any metadata graphics contained in the media item (such as album cover art) may not be available when it starts to play. This event alerts you when a metadata graphic item is finished downloading. You can then retrieve the IWMPMedia interface by passing the value of bstrItemName to the IWMPMediaCollection.getByName method, after which you can access the metadata graphic item by using IWMPMedia3.getItemInfoByType and specifying WM/Picture for the attribute name.
Requirements
Requirement | Value |
---|---|
Version |
Windows Media Player 9 Series or later |
Namespace |
AxWMPLib |
Assembly |
|