Ideas:
1. Read the directory file for the batch path.
2. Store with list.
3. Circular list List is added to the playlist.
public void Vidieoplay ()
{
Windowsmediaplayer1.uimode = "None"//Hide WMP Player Control Panel
Windowsmediaplayer1.url = ""//Load Media
Windowsmediaplayer1.stretchtofit = True
Windowsmediaplayer1.enablecontextmenu = True ' Allow right-click menu
WindowsMediaPlayer1.settings.autoStart = False to set autoplay
Windowsmediaplayer1.windowlessvideo = False
WindowsMediaPlayer1.Controls.play Playback
Windowsmediaplayer1.fullscreen = False ' Disable fullscreen
String Path = System.Environment.CurrentDirectory + @ "\\video"; Music or video Path
IWMPMedia Media;
WindowsMediaPlayer1.settings.setMode ("Loop", true);//set to loop play
DirectoryInfo dir = new DirectoryInfo (Path);
list<string> fileName = new list<string> (); Store the file name.
Looping files to the list of lists
foreach (FileInfo f in dir. GetFiles ())
{
Filename.add (F.name);
}
foreach (string item in FileName)
{
String FileName = Path + "\ \" + Item;
Media = Wmp_vidieo.newmedia (FileName); parameter is song path
WindowsMediaPlayer1.currentPlaylist.appendItem (media);//file added to the current list
}
WindowsMediaPlayer1.Ctlcontrols.play (); Start playback
}
WindowsMediaPlayer controls to batch add files to playlists