Partager via


Attribute Values for TV Content

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

Throughout this topic, the Player object was defined in the following manner:

AxWMPLib.AxWindowsMediaPlayer Player;
using WMPLib;

Windows Media Player 10 or later can organize TV content in the library. Windows Media Player treats TV content as a subcategory of video content. To make video content appear in the TV nodes in the library, set the WM/MediaClassPrimaryID and the WM/MediaClassSecondaryID attributes to the values in the following table by using the media.setItemInfo method:

Attribute Value
WM/MediaClassPrimaryID DB9830BD-3AB3-4FAB-8A37-1A995F7FF74B
WM/MediaClassSecondaryID BA7F258A-62F7-47A9-B21F-4651C42A000E

 

You can also use these values to determine whether a particular digital media item contains TV content by using the media.getItemInfo or media.getItemInfoByType methods.

Remember to use the GUID values as string values when specifying or retrieving these values.

The following C# example code sets the media class attributes so that a media item will be identified as TV content.

// Initialize the media object.
// This code assumes only 1 item named MyFile.
IWMPMedia3 media = (IWMPMedia3)Player.mediaCollection.getByName("MyFile").item(0);

// Set the primary media-class identifier.
media.setItemInfo("WM/MediaClassPrimaryID", "DB9830BD-3AB3-4FAB-8A37-1A995F7FF74B");

// Set the secondary media-class identifier.
media.setItemInfo("WM/MediaClassSecondaryID", "BA7F258A-62F7-47A9-B21F-4651C42A000E");

For more info about the possible values for the media class attributes, see the Windows Media Metadata Usage Guidelines.

Media Item Attributes

Library Access

Media Object