Reputation: 1794
I want to embed the vlc media player in a .NET application I've found a lot of solutions
I found 2 controls "VLC ActiveX plugin and IE web plugin v1" , "VLC ActiveX plugin and IE web plugin v2" What is the difference between them?? i dragged and dropped the fist one and used the following code
axVLCPlugin1.addTarget(@"D:\video\English\10,000.b.c\10000bc.rmvb", null, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666);
axVLCPlugin1.play();
that had no effect i dragged and dropped the second one and used the following code
axVLCPlugin21.playlist.add(@"D:\video\English\10,000.b.c\10000bc.rmvb");
axVLCPlugin21.playlist.play();
//i also tried this
axVLCPlugin21.playlist.playItem(0);
also it had no effect
I didn't found many details and documentations of the VLC OCX what is the error ?
Upvotes: 2
Views: 9440
Reputation: 4408
The plugin (v1 and v2) works fine in c#.net. v2 is better.
You need to use "file:///"
before the link:
axVLCPlugin1.addTarget(@"file:///D:\video\English\10,000.b.c\10000bc.rmvb", null, AXVLC.VLCPlaylistMode.VLCPlayListAppendAndGo, -666);
Upvotes: 1
Reputation: 21
The solution is simple: you need an uri, not a normal path
This:
var uri = new Uri(@"D:\video\English\10,000.b.c\10000bc.rmvb");
var converted = uri.AbsoluteUri;
axVLCPlugin21.playlist.add(converted);
There you go.
Upvotes: 1
Reputation: 13
It might be the file format. I also tried to use these two ActiveX controls to play media files in a MFC application. It worked with .avi and mp3 format, did not work with mp4 format. And if I remember it correctly, VLC does not have the codecs for .rmvb format in itself by default because of some copyright problem.
Upvotes: 1
Reputation: 70379
The v1 of the ActiveX is deprecated and v2 is primarily for browser integration thus not intended to be used like you tried...
Use http://vlcdotnet.codeplex.com/ - this is a well-working library...
Upvotes: 2