#

MediaStreamer für WPF
VLC von ZeBobo5 Vlc.DotNet

https://github.com/ZeBobo5/Vlc.DotNet
.NET control that hosts the audio/video capabilities of the VLC libraries



Hiermit kann man einen Media-Stream direkt in ein WPF oder Winform streamen, darstellen


Den Player kann man einfach einbinden über den Constructor VlcMediaPlayer
Und anschliessend steuern
Public method Pause
Public method Play
Public method SetMedia(VlcMedia)
Public method SetMedia(FileInfo,String[])
Public method SetMedia(Uri,String[])
Public method Stop

… wie hier bei den Events und
http://zebobo5.github.io/Vlc.DotNet/doc/html/325d230e-876c-f9e8-861e-b8b352dc88f7.htm

Events Name Description
Public event Backward
Public event Buffering
Public event EncounteredError
Public event EndReached
Public event Forward
Public event LengthChanged
Public event MediaChanged
Public event Opening
Public event PausableChanged
Public event Paused
Public event Playing
Public event PositionChanged
Public event ScrambledChanged
Public event SeekableChanged
Public event SnapshotTaken
Public event Stopped
Public event TimeChanged
Public event TitleChanged
Public event VideoOutChanged






Vlc Media Player für WPF war ursprünglich noch auf
http://vlcdotnet.codeplex.com/

wobei diese jetzt umgezogen sind auf GitHub
The project has moved to GitHub: Vlc.DotNet! A new version is being developed.

Vlc.DotNet 2011.11.29
The VlcDotNet libraries provide the audio/video control of the VLC Media Player for Windows Forms, WPF, and Silverlight 5. Now you can stream audio and video in C# and VB.NET!

You can see how to use it on the Documentation page.

Beispiel unter WPF
In XAML
  1. <Wpf:VlcControlx:Name="myVlcControl" />
  1. <GridGrid.Row="0">
  2. <Grid.Background>
  3. <VisualBrushStretch="Uniform">
  4. <VisualBrush.Visual>
  5. <ImageSource="{BindingElementName=myVlcControl,Path=VideoSource}" />
  6. </VisualBrush.Visual>
  7. </VisualBrush>
  8. </Grid.Background>
  9. </Grid>



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




Beispiel zum Einbinden in WinForms

Code Snippet

  1. [STAThread]
  2. staticvoidMain()
  1. {
  1. 4.Application.EnableVisualStyles();
  2. 5.Application.SetCompatibleTextRenderingDefault(false);
  1. //Set libvlc.dll and libvlccore.dll directory path
  2. 8.VlcContext.LibVlcDllsPath =CommonStrings.LIBVLC_DLLS_PATH_DEFAULT_VALUE_AMD64;
  3. //Set the vlc plugins directory path
  4. 10.VlcContext.LibVlcPluginsPath =CommonStrings.PLUGINS_PATH_DEFAULT_VALUE_AMD64;
  1. //Set the startup options
  2. 13.VlcContext.StartupOptions.IgnoreConfig =true;
  3. 14.VlcContext.StartupOptions.LogOptions.LogInFile =true;
  4. 15.VlcContext.StartupOptions.LogOptions.ShowLoggerConsole =true;
  5. 16.VlcContext.StartupOptions.LogOptions.Verbosity =VlcLogOptions.Verbosities.Debug;
  1. //Initialize the VlcContext
  2. 19.VlcContext.Initialize();
  1. 21.Application.Run(newForm1());
  1. //Close the VlcContext
  2. 24.VlcContext.CloseAll();
  1. }



Mobile

.

123movies