Player.currentPlaylist
[与此页面关联的功能(Windows 媒体播放器 SDK)是旧版功能。 它已被 MediaPlayer 取代。 MediaPlayer 已针对Windows 10和Windows 11进行了优化。 如果可能,Microsoft 强烈建议新代码使用 MediaPlayer 而不是 Windows 媒体播放器 SDK。 如果可能,Microsoft 建议重写使用旧 API 的现有代码以使用新 API。]
currentPlaylist 属性指定或检索当前 Playlist 对象。
语法
player 。currentPlaylist
可能的值
此属性是读/写 播放列表 对象。
备注
如果为“设置”。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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈