Hi,
I needed a decent Video playback engine for a small project I was doing and VLC is the best media player out there in my opinion.
I wanted to use VLC with WPF as the playback engine as MediaElement is rubbish. I've seen a lot of Interop wrappers but after a bit of research it is simple enough to Interop VLC into WPF so you don't need a 3rd party wrapper.
This is a decent article on how to interop media player
http://msdn.microsoft.com/en-us/library/ms748870.aspx
If your not aware, VS2005 & 2008 has a big bug with regards to Interop, unless you complile your Windows form control Interop wrapper with US regional settings the WPF designer crashes in Visual Studio although you can still run the code and edit the XAML manually. You need to change to US settings before you create wrapper project ! You can change back afterwards.
The problem is described here
http://connect.microsoft.com/VisualStud ... kID=392896
By following these steps you can get VLC into WPF quite nicely.
The VLC instance is defined here in XAML after adding the references to the project.
<Page x:Class="MovieSelect"
xmlns="http://schemas.microsoft.com/winfx/2006 ... esentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
xmlns:ax="clr-namespace:AxAXVLC;assembly=AxInterop.AXVLC"
Title="MovieSelect" Name="pgMovieSelect" Focusable="True">
<Grid>
<WindowsFormsHost Name="wfh" Margin="0,0,0,0">
<ax:AxVLCPlugin2 x:Name="VLCPlayer" >
</ax:AxVLCPlugin2>
</WindowsFormsHost>
</Grid>
</Page>
You can then call it from your .cs or .vb file.
Dim strFilename As String
strFilename = "\\SERVER\Movies\Goodfellas.mpg"
Me.VLCPlayer.playlist.add(strFilename, Nothing, Nothing)
Me.VLCPlayer.playlist.play()
This works a treat and all the usual VLC ActiveX interfaces are exposed.
Maybe I'm missing something and this approach has some limitations but for media playback it works fine, it's simple enough to create the interop wrapper and it seems stable under XP (SP3) and Vista SP1. It doesn't seem to leak although I force a System.GC.Collect() periodically to clear up memory.
I'm using AxVLCPlugin21 wrapper. You need to reference axvlc.dll in the pluggin sub directory as well in your Windows Forms Control.
I not trying to suggest this method is better than the other wrappers as I know the creators have put a lot of hard work into them, I just thought I'd post a solution I found to the problem.