Player.currentPlaylist

[與此頁面相關聯的功能Windows 媒體播放機 SDK是舊版功能。 它已被 MediaPlayer 取代MediaPlayer已針對Windows 10和Windows 11進行優化。 Microsoft 強烈建議新程式碼盡可能使用MediaPlayer,而不是Windows 媒體播放機 SDK。 Microsoft 建議盡可能重寫使用舊版 API 的現有程式碼,以使用新的 API。]

currentPlaylist 屬性會指定或擷取目前的 Playlist 物件。

Syntax

播放機currentPlaylist

可能的值

此屬性是可讀寫 的 Playlist 物件。

備註

如果 設定autoStart 屬性為 true,每當您設定 currentPlaylist時,就會自動開始播放。

此屬性會採用 Playlist 物件,其可透過數種方式取得,例如呼叫 PlaylistArrayitemPlaylistCollectionnewPlaylist。 若要使用檔案名載入 播放清單 專案,請設定 URL 屬性或使用 PlayernewPlaylist

範例

下列 JScript 範例會擷取文件庫中的第一個播放清單。 然後它會使用 currentPlaylist 讓擷取的播放清單成為目前的播放清單,然後顯示目前播放清單的名稱。 Player物件是以 ID = 「Player」 建立。

// Retrieve the first playlist from the library.
var firstPL = Player.playlistCollection.getAll().item(0);

// Make the retrieved playlist the current playlist.
Player.currentPlaylist = firstPL;

// Display the name of the current playlist.
document.write("Found first playlist. Name: " + Player.currentPlaylist.name);

規格需求

需求
版本
Windows 媒體播放機 7.0 版或更新版本。
DLL
Wmp.dll

另請參閱

Player 物件

Player.newPlaylist

Playlist 物件

PlaylistArray.item

PlaylistCollection.newPlaylist

Settings.autoStart