Monday, October 13, 2014

Use the VLC ActiveX Plugin v2

A long time ago I described in a post how to use the VLC ActiveX Plugin v1 to include the VLC player in a C# program. But since this is by now depecrated and replaced by its successor version v2, I want to explain the usage of that in this post. The principle is still the same, the notes regarding the installation etc. from the previous post still hold.
First we have to add the desired element to the toolbox. For this we right click on it and select "Choose items ..." and then "COM components".  Here we tick "VLC ActiveX Plugin and IE Web Plugin v2". Now we can add this control like any other to the form. The following code sets the volume to 50 % and then plays the desired file in the VLC control:

axVLCPlugin21.Volume = 50;
axVLCPlugin21.playlist.add(@"file:///pathtofile");
axVLCPlugin21.playlist.play();

4 comments:

  1. Hi. I keep getting an error "failed to import activex control" when dragging the control to my form... Do you have any ideas how to fix this? Thank you.

    ReplyDelete
    Replies
    1. use version 2.2.2 from nightly builds , as version 2.2.1 has a bug in vlx , it doesn't add AxAXVLC.dll in references

      Delete
  2. Hello, I am getting the same thing and I was wondering if you ever resolved this issue..
    Thank you!
    Andre
    acote@cdvi.ca

    ReplyDelete
  3. Hey,
    I develop application which use vlc plugin now I'm able to read the stream from rtsp but I wonder if it is possible to save it to file? Have you ever tried it?

    ReplyDelete