The currentPlaylist property gets or sets the current IWMPPlaylist interface that provides an easy way to organize and manipulate media items in a list.
The WMPLib.IWMPPlaylist interface that provides access to the current playlist.
If the IWMPSettings.autoStart property (also accessed via AxWindowsMediaPlayer.settings.autoStart) is true, playback begins automatically whenever you set currentPlaylist.
This property takes an IWMPPlaylist interface, which can be acquired in several ways, such as by getting the value from the IWMPPlaylistArray.Item or IWMPPlaylistCollection.newPlaylist properties. To load a playlist item using a file name, set the URL property or use AxWindowsMediaPlayer.newPlaylist.
The following example retrieves the first playlist in the library and uses the currentPlaylist property to set the retrieved playlist as the current playlist, and display its name. The AxWMPLib.AxWindowsMediaPlayer object is represented by the variable named player.
// Get an interface to the first playlist from the library. WMPLib.IWMPPlaylist firstPlaylist = player.playlistCollection.getAll().Item(0); // Make the retrieved playlist the current playlist. player.currentPlaylist = firstPlaylist; // Display the name of the current playlist. currentPlaylistLabel.Text = ("Found first playlist. Name = " + player.currentPlaylist.name);
|Windows Media Player 9 Series or later|
- AxWindowsMediaPlayer Object (VB and C#)
- AxWindowsMediaPlayer.newPlaylist (VB and C#)
- AxWindowsMediaPlayer.settings (VB and C#)
- IWMPPlaylist Interface (VB and C#)
- IWMPPlaylistArray.Item (VB and C#)
- IWMPPlaylistCollection.newPlaylist (VB and C#)
- IWMPSettings.autoStart (VB and C#)