Share via


Windows Media Player 11 SDK AxWindowsMediaPlayer.currentPlaylist (VB and C#) 

Windows Media Player SDK banner art

Previous Next

AxWindowsMediaPlayer.currentPlaylist (VB and C#)

The currentPlaylist property gets or sets the current IWMPPlaylist interface that provides an easy way to organize and manipulate media items in a list.

[Visual Basic]
Public Overridable Property currentPlaylist As IWMPPlaylist

[C#]
public virtual IWMPPlaylist currentPlaylist {get; set;}

Property Value

The WMPLib.IWMPPlaylist interface that provides access to the current playlist.

Remarks

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.

Example Code

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.

[Visual Basic]
' Get an interface to the first playlist from the library. 
Dim firstPlaylist As WMPLib.IWMPPlaylist = 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)

FakePre-2d3c930207464ed8a984d4dd30806c8c-9ab3fc16a8eb49a49befa8a1b298523e

// 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);

Requirements

Version: Windows Media Player 9 Series or later

Namespace: AxWMPLib

Assembly: AxInterop.WMPLib.dll (automatically generated by Visual Studio)

See Also

Previous Next