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 物件,其可透過數種方式取得,例如呼叫 PlaylistArray。item 或 PlaylistCollection。newPlaylist。 若要使用檔案名載入 播放清單 專案,請設定 URL 屬性或使用 Player。newPlaylist。
範例
下列 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 |
|
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應