AxWindowsMediaPlayer. currentPlaylist, propriété
La propriété currentPlaylist obtient ou définit l’interface IWMPPlaylist actuelle qui fournit un moyen simple d’organiser et de manipuler des éléments multimédias dans une liste.
Syntaxe
public IWMPPlaylist currentPlaylist {get; set;}
Public Property currentPlaylist As IWMPPlaylist
Valeur de la propriété
Interface WMPLib. IWMPPlaylist qui fournit l’accès à la sélection actuelle.
Remarques
Si la propriété IWMPSettings. AutoStart (également accessible via AxWindowsMediaPlayer. Settings.AutoStart) a la valeur true, la lecture commence automatiquement chaque fois que vous définissez currentPlaylist.
Cette propriété prend une interface IWMPPlaylist, qui peut être acquise de plusieurs façons, par exemple en obtenant la valeur de IWMPPlaylistArray. Item ou IWMPPlaylistCollection. Propriétés de newPlaylist . Pour charger un élément de sélection à l’aide d’un nom de fichier, définissez la propriété URL ou utilisez AxWindowsMediaPlayer. newPlaylist.
Exemples
L’exemple suivant récupère la première sélection de la bibliothèque et utilise la propriété currentPlaylist pour définir la sélection Récupérée comme playlist actuelle et afficher son nom. L’objet AxWMPLib. AxWindowsMediaPlayer est représenté par la variable 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);
' 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)
Configuration requise
| Condition requise | Valeur |
|---|---|
| Version |
Lecteur Windows Media série 9 ou version ultérieure |
| Espace de noms |
AxWMPLib |
| Assembly |
|