1:WindowsMediaPlayer.currentPlayList.XXXXXXX
循环可以设置
WindowsMediaPlayer.settings.setMode方法。具体参看MSDN或者微软站点上WindowsMediaPlayer SDK
2
rocedure TForm1.AddPlayFileToPlayList(const AFile: string;
IsUrl: Boolean = False);
var
ListItem: TListItem;
LyricFile: string;
currPlayList: IWMPPlaylist;
newMedia: IWMPMedia;
begin
ListItem := lvPlayList.Items.Add;
ListItem.ImageIndex := 0;
ListItem.Caption := ExtractFileName(AFile);
ListItem.SubItems.Add(AFile);
if not IsUrl then
begin
...
end;
if Player.currentPlaylist = nil then
begin
currPlayList := Player.newPlaylist('', '');
Player.currentPlaylist := currPlayList;
end;
newMedia := Player.newMedia(AFile);
Player.currentPlaylist.appendItem(newMedia);
Player.currentMedia := newMedia;
end;
最主要的还是
var
NewMedia: IWMPMedia;
begin
NewMedia := WindowsMediaPlayer1.newMedia('c:/abc.wmv');
WindowsMediaPlayer1.currentPlayList.appendItem(NewMedia);
WindowsMediaPlayer1.controls.play;
end;