2012-03-14 125 views
2

我想嵌入在.NET应用程序的VLC媒体播放器,我发现了很多解决的无法播放媒体与VLC OCX

  1. VLC的.Net接口< - 没有跟我
  2. 工作
  3. 包装的DLL函数<>
  4. http://vlcdotnet.codeplex.com这是很好
  5. 的VLC的activex - 我真的很喜欢使用它,它一定要少的缺陷和错误,但发现
错误

我发现2个控件“VLC ActiveX插件和IE网页插件v1”,“VLC ActiveX插件和IE网页插件v2” 他们之间有什么区别? 我拖放拳头一个和用下面的代码

axVLCPlugin1.addTarget(@"D:\video\English\10,000.b.c\10000bc.rmvb", null, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666); 
axVLCPlugin1.play(); 

即没有效果 我拖放第二个和用下面的代码

axVLCPlugin21.playlist.add(@"D:\video\English\10,000.b.c\10000bc.rmvb"); 
axVLCPlugin21.playlist.play(); 
//i also tried this 
axVLCPlugin21.playlist.playItem(0); 

还它没有任何效果

我没有发现VLC OCX 的许多细节和文档是什么错误?

+2

请不要用 “C#” 前缀的称号。这就是标签的用途。 – 2012-03-14 20:10:11

回答

2

v1 of the ActiveX is deprecatedv2 is primarily for browser integration因此不打算使用像你试过......

使用http://vlcdotnet.codeplex.com/ - 这是一个运作良好的图书馆......

+0

非常感谢。但我用vlcdotnet,它工作正常。有没有解决方案的ActiveX? – ahmedsafan86 2012-03-14 21:00:06

+0

@Ahmedsafan我不知道ActiveX的解决方案...你为什么要使用ActiveX? – Yahia 2012-03-14 21:00:47

+0

好吧我认为这会更好,但这是错误的,我将使用vlcdotnet来代替。 – ahmedsafan86 2012-03-14 22:34:11

1

这可能是文件格式。我也尝试使用这两个ActiveX控件在MFC应用程序中播放媒体文件。它与.avi和mp3格式一起工作,不支持mp4格式。如果我记得正确,由于版权问题,VLC默认没有.rmvb格式的编解码器。

1

解决方法很简单:你需要一个URL,而不是一个正常的路径

此:

var uri = new Uri(@"D:\video\English\10,000.b.c\10000bc.rmvb"); 
var converted = uri.AbsoluteUri; 
axVLCPlugin21.playlist.add(converted); 

你去那里。

1

插件(v1和v2)在c#.net中正常工作。 v2更好。

您需要的链接之前,使用"file:///"

axVLCPlugin1.addTarget(@"file:///D:\video\English\10,000.b.c\10000bc.rmvb", null, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666);