Windows Media Player 11 SDK Retrieving Metadata 

Windows Media Player SDK banner art

Retrieving Metadata

While a show or clip is playing, your script can retrieve metadata, such as title and author, by using the getItemInfo methods of the Windows Media Player Media and Playlist objects. You can retrieve metadata from the ASX scope using Playlist object methods and from the ENTRY scope using Media object methods.

For example, to retrieve the values for AUTHOR, ABSTRACT and PARAM in the following file, use the getItemInfo method of the Playlist object. The attribute name is required for this method. Attribute names can be obtained by providing the index number to the attributeName property. The available indexes for a Playlist object can be obtained using the attributeCount property.

Example Code

<ASX version="3.0">
    <AUTHOR>My Talking File</AUTHOR>
    <ABSTRACT>Talking File Album</ABSTRACT>
    <PARAM name="one" value="111"/>
        <REF href="Artists_Only.wma"/>
        <TITLE>Artists Only</TITLE>
        <PARAM name="three" value="333"/>
    <PARAM name="two" value="222"/>

To retrieve the values of the current Media object in the ENTRY scope for REF, TITLE, COPYRIGHT, and PARAM ("three"), use the currentMedia property of the Player object. Use the attributeCount property of the Media object to determine the number of attributes available for the specified Media object. Use index numbers with the getItemInfoByAtom method to retrieve attribute values. Use index numbers with the getAttributeName method of the Media object to determine the names of the available attributes, and then use the results with the getItemInfo method.

For an example of using Windows Media Player object methods to retrieve metadata, see Playlist.attributeCount.

See Also