Compartir a través de


IWMPMedia3::getItemInfoByType method

[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 getItemInfoByType method returns the value of the attribute corresponding to the specified attribute type and index.

Syntax

public System.Object getItemInfoByType(
  System.String bstrType,
  System.String bstrLanguage,
  System.Int32 lIndex
);

Public Function getItemInfoByType( _
  ByVal bstrType As System.String, _
  ByVal bstrLanguage As System.String, _
  ByVal lIndex As System.Int32 _
) As System.Object
Implements IWMPMedia3.getItemInfoByType

Parameters

bstrType [in]

A System.String that is the attribute type.

bstrLanguage [in]

A System.String that is the language. If the value is set to null or a zero-length string (""), the current locale string is used. Otherwise, the value must be a valid RFC 1766 language string such as "en-us".

lIndex [in]

A System.Int32 that is the attribute index.

Return value

A System.Object that is the value of the attribute. The type to cast this object to depends on the type of the attribute.

Remarks

This method returns the metadata for an individual digital media item or a media item that is part of a playlist.

This method supports attributes with multiple values and attributes with complex values. The getItemInfo method does not support attributes with multiple values and attributes with complex values.

The attributeCount property gets the number of attribute names available for a given media item. Index numbers can then be used with the getAttributeName method to determine the name of each available attribute. Individual attribute names can be passed to the name parameter of getItemInfoByType.

The getAttributeCountByType method returns the number of attributes that correspond to a particular attribute name for a given media item. Index numbers can then be passed to the index parameter of getItemInfoByType. This is useful when a media item has been categorized under multiple genres, for example.

If the media item came from a library that was retrieved by calling IWMPLibrary.mediaCollection, the set of available attributes will differ from those which can be queried from the local library retrieved by calling AxWindowsMediaPlayer.mediaCollection. For example, the attributes available from the local library retrieved by using IWMPLibrary will be a subset of the attributes available from the local library retrieved by using AxWindowsMediaPlayer. The set of attributes available from other sources (remote libraries, portable devices, or CDs is defined by the other sources.

Before calling this method, you must have read access to the library. For more information, see Library Access.

Requirements

Requirement Value
Version
Windows Media Player 9 Series or later
Namespace
WMPLib
Assembly
Interop.WMPLib.dll (Interop.WMPLib.dll.dll)

See also

IWMPMedia3 Interface (VB and C#)

IWMPMedia.attributeCount (VB and C#)

IWMPMedia.getAttributeName (VB and C#)

IWMPMedia.getItemInfo (VB and C#)

IWMPMedia3.getAttributeCountByType (VB and C#)