Share via


IWMPPlaylistCollection::importPlaylist 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 importPlaylist method adds a static playlist to the library.

Syntax

public IWMPPlaylist importPlaylist(
  IWMPPlaylist pItem
);

Public Function importPlaylist( _
  ByVal pItem As IWMPPlaylist _
) As IWMPPlaylist
Implements IWMPPlaylistCollection.importPlaylist

Parameters

pItem [in]

A WMPLib.IWMPPlaylist interface for the playlist that this method will add.

Return value

A WMPLib.IWMPPlaylist interface for the added playlist.

Remarks

Playlists that do not contain any media items cannot be added to the library by using this method. To create an empty playlist in the library, use the newPlaylist method. You can then fill the resulting playlist with media items by using IWMPPlaylist.appendItem or IWMPPlaylist.insertItem.

If you pass this method an auto playlist, the query is executed once and the result is added to the library as a static playlist. To add an auto playlist to the library and preserve its automatic behavior, use IWMPMediaCollection.add. For more information, see Static and Auto Playlists.

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

IWMPMediaCollection.add (VB and C#)

IWMPPlaylist Interface (VB and C#)

IWMPPlaylist.appendItem (VB and C#)

IWMPPlaylist.insertItem (VB and C#)

IWMPPlaylistCollection Interface (VB and C#)

IWMPPlaylistCollection.newPlaylist (VB and C#)