VLC management through C #

I am writing an application that will open vlc, add the file to my playlist and play it. I have a few questions in the last 2.

AXVLC.VLCPlugin alxplugin1 = new AXVLC.VLCPlugin(); alxplugin1.addTarget("C:\\test.avi", null, AXVLC.VLCPlaylistMode.VLCPlayListInsert, 0); alxplugin1.play(); 

This does not work ... Any ideas?

thanks

+5
c # vlc
source share
2 answers

The new version of VLC requires "file: ///" at the beginning of the file name. It should work if you add this. Please try the following and see if it solves your problem. use: alxplugin1.addTarget("file:///" + "C:\\test.avi", null, AXVLC.VLCPlaylistMode.VLCPlayListReplaceAndGo,0);

+4
source share

C # can access the VLC through the COM layer. The first thing to do is register the axvlc.dll file. Open the cmd window and type:

 C:\Windows\System32\regsvr32.exe C:\Program Files (x86)\VideoLAN\VLC\axvlc.dll 

You should receive a dialog box confirming the successful registration of your DLL. Open VisualStudio and create a new WinForms project and add a link to the COM COM COM object. Go to cs form file

 namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); AXVLC.VLCPlugin2Class p = new AXVLC.VLCPlugin2Class(); p.addTarget("C:\\zk.m4a", null, VLCPlaylistMode.VLCPlayListInsert, 0); p.play(); } } } 

Note: VLCPluginClass is deprecated, use VLCPlugin2Class

+2
source share

All Articles