Vlc.DotNet.Wpf : The Wpf control

This is the audio/video control for WPF.

!!! The control is only compatible with VideoLan >= 1.2 !!!

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

 

Code Snippet
  1. //Set libvlc.dll and libvlccore.dll directory path
  2. VlcContext.LibVlcDllsPath = CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
  3. //Set the vlc plugins directory path
  4. VlcContext.LibVlcPluginsPath = CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
  5.  
  6. //Set the startup options
  7. VlcContext.StartupOptions.IgnoreConfig = true;
  8. VlcContext.StartupOptions.LogOptions.LogInFile = true;
  9. VlcContext.StartupOptions.LogOptions.ShowLoggerConsole = true;
  10. VlcContext.StartupOptions.LogOptions.Verbosity = VlcLogVerbosities.Debug;
  11.  
  12. //Initialize the VlcContext
  13. VlcContext.Initialize();

 

 

After initialization, you must Close context on application closing:

 

Code Snippet
  1. VlcContext.CloseAll();

 

 

Xaml intégration example

Code Snippet
  1. <Wpf:VlcControl x:Name="myVlcControl" />
  2.  
  3. <Grid Grid.Row="0">
  4.      <Grid.Background>
  5.          <VisualBrush Stretch="Uniform">
  6.              <VisualBrush.Visual>
  7.                  <Image Source="{Binding ElementName=myVlcControl, Path=VideoSource}" />
  8.              </VisualBrush.Visual>
  9.          </VisualBrush >
  10.     </Grid.Background>
  11. </Grid>
 

Last edited Jun 6, 2011 at 12:24 PM by ZeBobo5, version 9