Windows Media Player 11 SDK MediaCollection.add 

Windows Media Player SDK banner art

Previous Next

MediaCollection.add

The add method adds a new media item or playlist to the library.

Syntax

  

Parameters

path

String containing the path.

Return Values

This method returns a Media object.

Remarks

This method loads an existing media item or playlist into the library, given a path to a file. This method does not move or change the file. This method fails if given an invalid local path, but digital media files are not checked for validity before they are added to the library.

This method accepts both static and auto playlist files. The PlaylistCollection**.importPlaylist** method can also be used to add a static playlist to the library.

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

Example Code

The following Microsoft JScript example adds three media objects to the Windows Media Player media collection. 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