AxWindowsMediaPlayer.currentPlaylist プロパティ

[このページWindows メディア プレーヤー SDK に関連付けられている機能は、レガシ機能です。 MediaPlayer に置き換わりました。 MediaPlayer は、Windows 10とWindows 11用に最適化されています。 新しいコードでは、可能な場合は SDK ではなく MediaPlayerWindows メディア プレーヤー使用することを強くお勧めします。 Microsoft は、従来の API を使用する既存のコードを、可能であれば新しい API を使用するように書き直すよう提案しています。]

currentPlaylist プロパティは、リスト内のメディアアイテムを簡単に整理および操作する方法を提供する現在の IWMPPlaylist インターフェイスを取得または設定します。

構文

public IWMPPlaylist currentPlaylist {get; set;}

Public Property currentPlaylist As IWMPPlaylist

プロパティ値

現在のプレイリストへのアクセスを提供する WMPLib.IWMPPlaylist インターフェイス。

解説

IWMPSettings.autoStart プロパティ (AxWindowsMediaPlayer.settings からもアクセスする場合)。autoStart) が true の場合、 currentPlaylist を設定するたびに自動的に再生が開始されます。

このプロパティは IWMPPlaylist インターフェイスを受け取ります。 IWMPPlaylistArray から値を取得するなど、いくつかの方法で取得できます。Item または IWMPPlaylistCollectionnewPlaylist プロパティ。 ファイル名を使用して プレイリスト 項目を読み込むには、URL プロパティを設定するか、AxWindowsMediaPlayer を使用します。newPlaylist

次の例では、ライブラリ内の最初のプレイリストを取得し、currentPlaylist プロパティを使用して、取得したプレイリストを現在のプレイリストとして設定し、その名前を表示します。 AxWMPLib.AxWindowsMediaPlayer オブジェクトは、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)

要件

要件
Version
Windows メディア プレーヤー 9 シリーズ以降
名前空間
AxWMPLib
アセンブリ
AxInterop.WMPLib.dll (AxInterop.WMPLib.dll.dll)

関連項目

AxWindowsMediaPlayer オブジェクト (VB および C#)

AxWindowsMediaPlayer.newPlaylist (VB および C#)

AxWindowsMediaPlayer.settings (VB および C#)

IWMPPlaylist インターフェイス (VB および C#)

IWMPPlaylistArray.Item (VB および C#)

IWMPPlaylistCollection.newPlaylist (VB および C#)

IWMPSettings.autoStart (VB および C#)