Player.currentPlaylist

[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]

currentPlaylist 属性指定或检索当前 Playlist 对象。

语法

playercurrentPlaylist

可能的值

此属性是读/写 播放列表 对象。

备注

如果为“设置”。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