Я создаю приложение для непрерывного воспроизведения видеофайлов из заданной папки.
Вот то, что я использовал для воспроизведения одного файла, указав путь.
axWindowsMediaPlayer1.URL = @"D:\ShortVideoFolder\Asterix And The Vikings - YouTube.MKV";
axWindowsMediaPlayer1.settings.autoStart = true;
axWindowsMediaPlayer1.stretchToFit = true;
axWindowsMediaPlayer1.settings.setMode("loop", true);
Это работает просто отлично.
Это то, что я сделал, чтобы получить доступ ко всем видеофайлам в папке и воспроизвести эти файлы.
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;
}
Это не проигрывает ни одного файла. и не выдает сообщение об ошибке тоже. Что я здесь не так делаю?