Zonghan Zhan
Zonghan Zhan

Reputation: 1

Freezing occurs when playing videos continuously using Vlc.DotNet

Freezing occurs when playing videos continuously using Vlc.DotNet?

The program code is as follows:

int ListNum = 0;
List<string> PlayList = new List<string>();
string[] AllFiles;

private void PlayVedioFiles() {
    vlcControl1.Audio.Volume = 0;
    ListNum = 0;
    AllFiles = Directory.GetFiles("F:\\VedioFiles");
    foreach (string strFile in AllFiles) {
        PlayList.Add(strFile);
    }
    SetThreadPool();
    ThreadPool.QueueUserWorkItem(_ => this.vlcControl1.Play(new System.IO.FileInfo(PlayList[ListNum])));
}

private void vlcControl1_EndReached(object sender, Vlc.DotNet.Core.VlcMediaPlayerEndReachedEventArgs e) {
    if (ListNum >= PlayList.Count) {
        ListNum = 0;
    }
    if (ListNum < PlayList.Count) {
        ThreadPool.QueueUserWorkItem(_ => this.vlcControl1.Play(new System.IO.FileInfo(PlayList[ListNum++])));
    }
}

How to deal with it?

Upvotes: 0

Views: 71

Answers (0)

Related Questions