2012-03-14 123 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);