Compartir a través de


IWMPMediaCollection (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 methods that can be used to organize a large collection of media items.

Members

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

Methods

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

Method Description
add Adds a new media item or playlist to the library.
getAll Returns an IWMPPlaylist interface that corresponds to the playlist that contains all media items in the library.
getAttributeStringCollection Returns an IWMPStringCollection interface that represents the set of all values for a specified attribute within a media type.
getByAlbum Returns an IWMPPlaylist interface that provides access to media items from the specified album.
getByAttribute Returns an IWMPPlaylist interface that corresponds to the specified attribute having the specified value.
getByAuthor Returns an IWMPPlaylist interface that provides access to the media items by the specified author.
getByGenre Returns an IWMPPlaylist interface that provides access to media items of the specified genre.
getByName Returns an IWMPPlaylist interface that provides access to media items with the specified name.
getMediaAtom Returns the index of a specified attribute.
isDeleted No longer supported.
remove Removes the specified media item from the media collection.
setDeleted Moves the specified media item to the deleted items folder.

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

Object or interface Property
AxWindowsMediaPlayer mediaCollection
IWMPLibrary mediaCollection

Requirements

Requirement Value
Header
Wmp.h

See also

Interfaces for Visual Basic .NET and C#

IWMPMediaCollection2 Interface

IWMPPlaylist Interface (VB and C#)

IWMPStringCollection Interface (VB and C#)