I am writing an application that will open vlc, add a file to its playlist, and play it. I am having a few issues on the last 2.
AXVLC.VLCPlugin alxplugin1 = new AXVLC.VLCPlugin();
alxplugin1.addTarget("C:\\test.avi", null, AXVLC.VLCPlaylistMode.VLCPlayListInsert, 0);
alxplugin1.play();
This isn't working... Any ideas?
Thanks
The newer version of VLC needs "file:///" in 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);
C# can access VLC through it's COM layer. First thing to do is to register the axvlc.dll. Open a cmd window and type:
C:\Windows\System32\regsvr32.exe C:\Program Files (x86)\VideoLAN\VLC\axvlc.dll
You should receive a dialog confirming that your dll was registered successfully. Open VisualStudio and create a new WinForms project and add a reference to the COM VLC COM object. Go to the Form cs 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: The VLCPluginClass was deprecated, use VLCPlugin2Class
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With