Share via


Attributes with Multiple Values (Windows Media Player SDK)

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

Some media item attributes can have multiple values. For example, the Author, WM/Composer, and WM/Genre attributes can each have more than one value. The data type of such attributes is multi-valued string.

In Windows Media Player, the library displays multiple values in a single field, separating the values with semicolons. However, each value is actually a separate attribute in the Windows Media item.

You can write code that will determine whether a given attribute has multiple values and then retrieve all of those values. You must use Media.getItemInfoByType. If you use the Media.getItemInfo method to retrieve a multi-valued attribute, you will only retrieve the first value.

The final example in the Reading Attribute Values topic demonstrates the use of the Media.getAttributeCountByType and Media.getItemInfoByType methods to retrieve multiple values for a given attribute.

Media Item Attributes

Media Object

Reading Attribute Values from a CD or DVD