第一步: NuGet安装 Vlc

第二步:窗体里添加vlc控件

第三步:添加VlcLibDirectoryNeeded事件
事件代码:
private void vlcControl1_VlcLibDirectoryNeeded(object sender, Vlc.DotNet.Forms.VlcLibDirectoryNeededEventArgs e)
{
var currentAssembly = Assembly.GetEntryAssembly();
var currentDirectory = new FileInfo(currentAssembly.Location).DirectoryName;
if (currentDirectory == null)
return;
if (IntPtr.Size == 4)
e.VlcLibDirectory = new DirectoryInfo(Path.

这篇博客介绍了如何在C#项目中集成VLC播放器。首先通过NuGet安装Vlc,然后在窗体中添加VLC控件。接着详细讲解了添加VlcLibDirectoryNeeded事件,并提供了事件代码。最后,强调需要将libvlc相关的DLL文件放入程序目录才能正常运行。
最低0.47元/天 解锁文章
2349

被折叠的 条评论
为什么被折叠?



