Windows Media Player 11 SDK PlaylistCollection.newPlaylist 

Windows Media Player SDK banner art

Previous Next

PlaylistCollection.newPlaylist

The newPlaylist method creates a new playlist in the library.

Syntax

  

Parameters

name

String containing the name of the playlist to be created.

Return Values

This method returns a Playlist object.

Remarks

This method creates an empty playlist in the library. To fill the playlist with media items, use Playlist**.appendItem** or Playlist**.insertItem**.

Multiple playlists having the same name are permitted in the library. To avoid creating a duplicate playlist name with this method, use getByName and PlaylistArray**.count** to determine whether a playlist with a particular name already exists.

Leading and trailing spaces are not permitted in playlist names, and are automatically removed from the value specified for the name parameter.

To use this method, full access to the library is required. For more information, see Library Access.

Example Code

The following JScript example creates a new empty playlist called "ThreeList". The Player object was created with ID="Player".

  

Requirements

Version: Windows Media Player version 7.0 or later.

Library: Use wmp.dll.

See Also

Previous Next