I'm building an application to play video files of a given folder continuously.
Here's what I used to play a single file by giving the path.
axWindowsMediaPlayer1.URL = @"D:\ShortVideoFolder\Asterix And The Vikings - YouTube.MKV";
axWindowsMediaPlayer1.settings.autoStart = true;
axWindowsMediaPlayer1.stretchToFit = true;
axWindowsMediaPlayer1.settings.setMode("loop", true);
This is working just fine. This is what I did to access all video files in the folder and play those files.
string folderPath = ConfigurationManager.AppSettings["videoFolderPath"]; //Getting folder path saved in App.config file
string[] fileNames = Directory.GetFiles(@folderPath); //Getting file names of each and every file name in the folder
foreach (string file in fileNames)
{
axWindowsMediaPlayer1.URL = @"folderPath" + "file";
axWindowsMediaPlayer1.settings.autoStart = true;
}
This doesn't play a single file. and doesn't give an error message too. What am I doing wrong here?