Vlc.DotNet.Forms : The WinForms control

This is the audio/video control for WinForms 2.0.

First of all, you must initialize the VlcContext before loading a VlcControl on your form or code:

 

Code Snippet
  1. [STAThread]
  2. static void Main()
  3. {
  4.     Application.EnableVisualStyles();
  5.     Application.SetCompatibleTextRenderingDefault(false);
  6.  
  7.     //Set libvlc.dll and libvlccore.dll directory path
  8.     VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
  9.     //Set the vlc plugins directory path
  10.     VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
  11.  
  12.     //Set the startup options
  13.     VlcContext.StartupOptions.IgnoreConfig = true;
  14.     VlcContext.StartupOptions.LogOptions.LogInFile = true;
  15.     VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
  16.     VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogOptions.Verbosities.Debug;
  17.  
  18.     //Initialize the VlcContext
  19.     VlcContext.Initialize();
  20.  
  21.     Application.Run(new Form1());
  22.  
  23.     //Close the VlcContext
  24.     VlcContext.CloseAll();
  25. }

After that, you can use the VlcControl with designer or by code.

As you can see, you must also close the VlcContext when the application closes.

Last edited Oct 2, 2014 at 2:17 PM by RexGrammer, version 9