我希望有人可以帮助我,我想播放另一个视频文件,但是当我双击另一个视频文件时它不会播放它,只显示第一个视频文件的最后一帧。我不确定我做错了什么。
下面是我的代码
void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
{
string final = "file path";
playfile(final);
}
void playfile(string final)
{
var control = new VlcControl();
var currentAssembly = Assembly.GetEntryAssembly();
var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
// Default installation path of VideoLAN.LibVLC.Windows
var libDirectory = new DirectoryInfo(Path.Combine(currentDirectory, "libvlc", IntPtr.Size == 4 ? "win-x86" : "win-x64"));
control.BeginInit();
control.VlcLibDirectory = libDirectory;
control.Dock = DockStyle.Fill;
control.EndInit();
panel1.Controls.Add(control);
control.ResetMedia();
control.Play(new Uri(final).AbsoluteUri);
}
我试过像
control.Dispose();
control.ResetMedia();
control.Update();
control.Refresh();
我什至试图操纵面板但是没有用
谢谢