简体   繁体   English

如何将VLC嵌入到我的C#项目中?

[英]How can I embed VLC into my C# Project?

I have been trying to do this for a couple days and I'm getting nowhere. 我一直试图这样做几天,我无处可去。 I have used/downloaded the Vlc.DotNet.Core/Interops/Forms built them, and imported the DLLs and my issue is when I try to reference the AXVLC.DLL and try to use the COM plugin in my form. 我已经使用/下载了Vlc.DotNet.Core / Interops / Forms构建它们,并导入了DLL,我的问题是当我尝试引用AXVLC.DLL并尝试在我的表单中使用COM插件时。

I get two errors 我收到两个错误

  1. VLC ActiveX Plugin and IE Web Plugin v1 - Failed to import the ActiveX control. VLC ActiveX插件和IE Web插件v1 - 无法导入ActiveX控件。 Please ensure it is properly registered. 请确保它已正确注册。

  2. VLC ActiveX Plugin and IE Web Plugin v2 - Completely crashes Visual Studio 2015. VLC ActiveX插件和IE Web插件v2 - 完全崩溃Visual Studio 2015。

I have installed 6+ different nightly releases of VLC player and tried each AXVLC.DLL but they all do the same thing. 我已经安装了6个不同的夜间版本的VLC播放器,并尝试了每个AXVLC.DLL,但它们都做同样的事情。 VLC 3.0.x and VLC 2.2.x VLC 3.0.x和VLC 2.2.x.

I have also tried it in Visual Studio 2012 with the same results. 我也在Visual Studio 2012中尝试过相同的结果。

I'd say use the Vlc.DotNet.Forms from nuget package manager under tools. 我想说在工具下使用nuget包管理器中的Vlc.DotNet.Forms。 Usage is quite a bit simpler than ActiveX. 用法比ActiveX简单得多。

FileInfo media = new FileInfo(<fullpath to mediafile>);
VlcControl1.SetMedia(media);
VlcControl1.play();

VlcControl1.Video.Adjustment (.Enable = true -> under same tree all video settings) and VlcControl1.Video.Adjustment (.Enable = true - >在同一树下所有视频设置)

VlcControl1.Audio (all audio settings) VlcControl1.Audio (所有音频设置)

If you have to use ActiveX player I'd go with the WMP (Project -> Add reference -> Windows Media Player (ActiveX). Which basically is few times better and native, if using ActiveX. 如果你必须使用ActiveX播放器,我将使用WMP(项目 - >添加参考 - > Windows Media Player(ActiveX)。如果使用ActiveX,这基本上是好几倍和原生的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM