IWMPMedia (VB and C#) interface

[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.]

Provides a way to set and retrieve the properties of a media item.

The IWMPMedia interface exposes the following properties.

Members

The IWMPMedia (VB and C#) interface has these types of members:

Methods

The IWMPMedia (VB and C#) interface has these methods.

Method Description
getAttributeName Returns the name of the attribute corresponding to the specified index.
getItemInfo Returns the value of the specified attribute for the media item.
getItemInfoByAtom Returns the value of the attribute with the specified index number.
getMarkerName Returns the name of the marker at the specified index.
getMarkerTime Returns the time of the marker at the specified index.
isMemberOf Returns a value indicating whether the specified media item is a member of the specified playlist.
isReadOnlyItem Returns a value indicating whether the attributes of the specified media item can be edited.
setItemInfo Sets the value of the specified attribute for the media item.

Properties

The IWMPMedia (VB and C#) interface has these properties.

Property Access type Description
attributeCount
Read-only
Gets the number of attributes that can be queried and/or set for the media item.
duration
Read-only
Gets the duration in seconds of the current media item.
durationString
Read-only
Gets a value indicating the duration of the current media item in HH:MM:SS format.
imageSourceHeight
Read-only
Gets the height of the current media item in pixels.
imageSourceWidth
Read-only
Gets the width of the current media item in pixels.
isIdentical
Read-only
Gets a value indicating whether the specified media item is the same as the current one. In C#, this is the get_isIdentical method.
markerCount
Read-only
Gets the number of markers in the media item.
name
Read-only
Gets or sets the name of the media item.
sourceURL
Read-only
Gets the URL of the media item.

Get an IWMPMedia interface by using the following properties or methods accessed through the following object or interface.

Object or interface Property or method
IWMPControls currentitem
AxWindowsMediaPlayer currentMedia, newMedia
IWMPPlaylist Item (get_Item in C#)

Requirements

Requirement Value
Header
Wmp.h

See also

Interfaces for Visual Basic .NET and C#

IWMPMedia2 Interface (VB and C#)

IWMPMedia3 Interface (VB and C#)