From e0c8001dc93b90da2483f42d3ae60d4b91982e9a Mon Sep 17 00:00:00 2001 From: Ch4rg3r Date: Tue, 3 Jul 2018 18:52:07 +0200 Subject: [PATCH 01/13] Basic Wpf UserControl Added Wpf UserControl with Autosizing using WindowsFormsHost --- LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj | 67 ++++++++++ LibVLCSharp.Wpf/Properties/AssemblyInfo.cs | 36 ++++++ LibVLCSharp.Wpf/VLCViewControl.xaml | 17 +++ LibVLCSharp.Wpf/VLCViewControl.xaml.cs | 72 +++++++++++ LibVLCSharp.sln | 89 ++++++++++++- LibVlcSharp.Wpf.Sample/App.config | 6 + LibVlcSharp.Wpf.Sample/App.xaml | 9 ++ LibVlcSharp.Wpf.Sample/App.xaml.cs | 17 +++ .../LibVLCSharp.Wpf.Sample.csproj | 106 ++++++++++++++++ LibVlcSharp.Wpf.Sample/MainWindow.xaml | 13 ++ LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs | 42 +++++++ .../Properties/AssemblyInfo.cs | 55 ++++++++ .../Properties/Resources.Designer.cs | 63 ++++++++++ .../Properties/Resources.resx | 117 ++++++++++++++++++ .../Properties/Settings.Designer.cs | 26 ++++ .../Properties/Settings.settings | 7 ++ 16 files changed, 740 insertions(+), 2 deletions(-) create mode 100644 LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj create mode 100644 LibVLCSharp.Wpf/Properties/AssemblyInfo.cs create mode 100644 LibVLCSharp.Wpf/VLCViewControl.xaml create mode 100644 LibVLCSharp.Wpf/VLCViewControl.xaml.cs create mode 100644 LibVlcSharp.Wpf.Sample/App.config create mode 100644 LibVlcSharp.Wpf.Sample/App.xaml create mode 100644 LibVlcSharp.Wpf.Sample/App.xaml.cs create mode 100644 LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj create mode 100644 LibVlcSharp.Wpf.Sample/MainWindow.xaml create mode 100644 LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs create mode 100644 LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs create mode 100644 LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs create mode 100644 LibVlcSharp.Wpf.Sample/Properties/Resources.resx create mode 100644 LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs create mode 100644 LibVlcSharp.Wpf.Sample/Properties/Settings.settings diff --git a/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj new file mode 100644 index 000000000..72627384e --- /dev/null +++ b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj @@ -0,0 +1,67 @@ + + + + + Debug + AnyCPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F} + Library + Properties + LibVLCSharp.Wpf + LibVLCSharp.Wpf + v4.6.1 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + VLCViewControl.xaml + + + + + {d1c3b7c4-713b-46b2-b33a-e9298c819921} + LibVLCSharp + + + + + MSBuild:Compile + + + + \ No newline at end of file diff --git a/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs b/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..823683a52 --- /dev/null +++ b/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("LibVLCSharp.Wpf")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LibVLCSharp.Wpf")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("da7a2677-0944-481f-a59b-9128fc54fd5f")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// indem Sie "*" wie unten gezeigt eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LibVLCSharp.Wpf/VLCViewControl.xaml b/LibVLCSharp.Wpf/VLCViewControl.xaml new file mode 100644 index 000000000..eeba4d789 --- /dev/null +++ b/LibVLCSharp.Wpf/VLCViewControl.xaml @@ -0,0 +1,17 @@ + + + + + + + + + \ No newline at end of file diff --git a/LibVLCSharp.Wpf/VLCViewControl.xaml.cs b/LibVLCSharp.Wpf/VLCViewControl.xaml.cs new file mode 100644 index 000000000..2813a4719 --- /dev/null +++ b/LibVLCSharp.Wpf/VLCViewControl.xaml.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace LibVLCSharp.Wpf +{ + public partial class VLCViewControl : UserControl, LibVLCSharp.Shared.IVideoView + { + private LibVLCSharp.Shared.MediaPlayer mediaPlayer; + private LibVLCSharp.Shared.LibVLC libVLC; + private double controlWidth; + private double controlHeight; + + public VLCViewControl() + { + Shared.Core.Initialize(); + libVLC = new Shared.LibVLC(); + mediaPlayer = new Shared.MediaPlayer(libVLC); + + InitializeComponent(); + this.SizeChanged += OnSizeChanged; + + controlHeight = this.Height; + controlWidth = this.Width; + + mediaPlayer.Hwnd = PlayerView.Handle; + } + + private void VLCResize() + { + uint h = 0, w = 0; + float scale = 1, scalew = 1, scaleh = 1; + + if (mediaPlayer.Size(0, ref w, ref h)) + { + scalew = (float)controlWidth / (float)w; + w = (uint)controlWidth; + + scaleh = (float)controlHeight / (float)h; + h = (uint)controlHeight; + + scale = scalew < scaleh ? scalew : scaleh; + mediaPlayer.Scale = scale; + } + } + + private void OnSizeChanged(object sender, SizeChangedEventArgs e) + { + controlWidth = e.NewSize.Width; + controlHeight = e.NewSize.Height; + + if (mediaPlayer.IsPlaying) + { + VLCResize(); + } + } + + public LibVLCSharp.Shared.MediaPlayer MediaPlayer { get => mediaPlayer; } + public LibVLCSharp.Shared.LibVLC LibVLC { get => libVLC; } + } +} diff --git a/LibVLCSharp.sln b/LibVLCSharp.sln index 248c7d62d..dc20e962c 100644 --- a/LibVLCSharp.sln +++ b/LibVLCSharp.sln @@ -27,13 +27,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.iOS.Sample", "L EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{799A84A2-2161-4676-878B-5610E3586137}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms", "LibVLCSharp.Forms\LibVLCSharp.Forms.csproj", "{656D01BE-FBEA-491A-AB2C-4B6B375B52A9}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.Forms", "LibVLCSharp.Forms\LibVLCSharp.Forms.csproj", "{656D01BE-FBEA-491A-AB2C-4B6B375B52A9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample.Android", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.Android\LibVLCSharp.Forms.Sample.Android.csproj", "{C77C28DD-A2B2-403C-A907-76184BD5D11E}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample.iOS", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.iOS\LibVLCSharp.Forms.Sample.iOS.csproj", "{D2486BCF-A218-4181-B1F8-E6D46DCADCDC}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.csproj", "{C6E79ABC-C203-4892-848A-FF99CCE53F8A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.Forms.Sample", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.csproj", "{C6E79ABC-C203-4892-848A-FF99CCE53F8A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Wpf.Sample", "LibVlcSharp.Wpf.Sample\LibVLCSharp.Wpf.Sample.csproj", "{01CCB934-B77F-4681-86C5-AE4FEE648238}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Wpf", "LibVLCSharp.Wpf\LibVLCSharp.Wpf.csproj", "{DA7A2677-0944-481F-A59B-9128FC54FD5F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -517,6 +521,86 @@ Global {C6E79ABC-C203-4892-848A-FF99CCE53F8A}.Release|x64.Build.0 = Release|Any CPU {C6E79ABC-C203-4892-848A-FF99CCE53F8A}.Release|x86.ActiveCfg = Release|Any CPU {C6E79ABC-C203-4892-848A-FF99CCE53F8A}.Release|x86.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|x64.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Ad-Hoc|x86.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|Any CPU.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|iPhone.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|x64.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|x64.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|x86.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.AppStore|x86.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|Any CPU.Build.0 = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|iPhone.Build.0 = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|x64.ActiveCfg = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|x64.Build.0 = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|x86.ActiveCfg = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Debug|x86.Build.0 = Debug|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|Any CPU.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|Any CPU.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|iPhone.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|iPhone.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|x64.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|x64.Build.0 = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|x86.ActiveCfg = Release|Any CPU + {01CCB934-B77F-4681-86C5-AE4FEE648238}.Release|x86.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|iPhone.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|iPhone.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|x64.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|x64.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|x86.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Ad-Hoc|x86.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|Any CPU.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|Any CPU.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|iPhone.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|iPhone.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|x64.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|x64.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|x86.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.AppStore|x86.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|iPhone.Build.0 = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|x64.ActiveCfg = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|x64.Build.0 = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|x86.ActiveCfg = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Debug|x86.Build.0 = Debug|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|Any CPU.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|iPhone.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|iPhone.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|x64.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|x64.Build.0 = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|x86.ActiveCfg = Release|Any CPU + {DA7A2677-0944-481F-A59B-9128FC54FD5F}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -528,6 +612,7 @@ Global {C77C28DD-A2B2-403C-A907-76184BD5D11E} = {799A84A2-2161-4676-878B-5610E3586137} {D2486BCF-A218-4181-B1F8-E6D46DCADCDC} = {799A84A2-2161-4676-878B-5610E3586137} {C6E79ABC-C203-4892-848A-FF99CCE53F8A} = {799A84A2-2161-4676-878B-5610E3586137} + {01CCB934-B77F-4681-86C5-AE4FEE648238} = {799A84A2-2161-4676-878B-5610E3586137} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {AB1424F9-871B-444A-9278-18227672889C} diff --git a/LibVlcSharp.Wpf.Sample/App.config b/LibVlcSharp.Wpf.Sample/App.config new file mode 100644 index 000000000..731f6de6c --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/LibVlcSharp.Wpf.Sample/App.xaml b/LibVlcSharp.Wpf.Sample/App.xaml new file mode 100644 index 000000000..fb82cdc5d --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/LibVlcSharp.Wpf.Sample/App.xaml.cs b/LibVlcSharp.Wpf.Sample/App.xaml.cs new file mode 100644 index 000000000..d1695692e --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace LibVlcSharp.Wpf.Sample +{ + /// + /// Interaktionslogik für "App.xaml" + /// + public partial class App : Application + { + } +} diff --git a/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj b/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj new file mode 100644 index 000000000..eda539503 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {01CCB934-B77F-4681-86C5-AE4FEE648238} + WinExe + LibVLCSharp.Wpf.Sample + LibVLCSharp.Wpf.Sample + v4.6.1 + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 4.0 + + + + + + + + MSBuild:Compile + + + MSBuild:Compile + Designer + + + App.xaml + Code + + + MainWindow.xaml + Code + + + + + Code + + + True + True + Resources.resx + + + True + Settings.settings + True + + + ResXFileCodeGenerator + Resources.Designer.cs + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + + + + + + {da7a2677-0944-481f-a59b-9128fc54fd5f} + LibVLCSharp.Wpf + + + {d1c3b7c4-713b-46b2-b33a-e9298c819921} + LibVLCSharp + + + + \ No newline at end of file diff --git a/LibVlcSharp.Wpf.Sample/MainWindow.xaml b/LibVlcSharp.Wpf.Sample/MainWindow.xaml new file mode 100644 index 000000000..9e347def3 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/MainWindow.xaml @@ -0,0 +1,13 @@ + + + + + diff --git a/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs b/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs new file mode 100644 index 000000000..e6f3a4d36 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using LibVLCSharp.Shared; + +namespace LibVLCSharp.Wpf.Sample +{ + public partial class MainWindow : Window + { + private System.Windows.Threading.DispatcherTimer dispatcherTimer = new System.Windows.Threading.DispatcherTimer(); + + public MainWindow() + { + InitializeComponent(); + + Player.MediaPlayer.Play(new Media(Player.LibVLC, + "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", Media.FromType.FromLocation)); + + dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); + dispatcherTimer.Interval = new TimeSpan(0, 0, 10); + dispatcherTimer.Start(); + } + + private void dispatcherTimer_Tick(object sender, EventArgs e) + { + this.Width = 900; + this.Height = 750; + dispatcherTimer.Stop(); + } + } +} \ No newline at end of file diff --git a/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs b/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..b10c039f6 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("LibVLCSharp.Wpf.Sample")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("LibVLCSharp.Wpf.Sample")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie +//ImCodeVerwendeteKultur in der .csproj-Datei +//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch +//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung +//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, +//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) + ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs + //(wird verwendet, wenn eine Ressource auf der Seite nicht gefunden wird, + // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) +)] + + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs b/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs new file mode 100644 index 000000000..db2c59150 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace LibVLCSharp.Wpf.Sample.Properties { + using System; + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder automatisch generiert + // -Klasse über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der /str-Option erneut aus, oder Sie erstellen Ihr VS-Projekt neu. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LibVLCSharp.Wpf.Sample.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenzuordnungen, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/LibVlcSharp.Wpf.Sample/Properties/Resources.resx b/LibVlcSharp.Wpf.Sample/Properties/Resources.resx new file mode 100644 index 000000000..af7dbebba --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs b/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs new file mode 100644 index 000000000..a5d1c030d --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.42000 +// +// Änderungen an dieser Datei können falsches Verhalten verursachen und gehen verloren, wenn +// der Code erneut generiert wird. +// +//------------------------------------------------------------------------------ + +namespace LibVLCSharp.Wpf.Sample.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.7.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/LibVlcSharp.Wpf.Sample/Properties/Settings.settings b/LibVlcSharp.Wpf.Sample/Properties/Settings.settings new file mode 100644 index 000000000..033d7a5e9 --- /dev/null +++ b/LibVlcSharp.Wpf.Sample/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 9e5ab1b077fea07b44192ea7d4895763f442a0f8 Mon Sep 17 00:00:00 2001 From: Ch4rg3r Date: Wed, 4 Jul 2018 12:46:22 +0200 Subject: [PATCH 02/13] Changes to WPF-UserControl - Renaming - Disposable --- LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj | 10 +-- LibVLCSharp.Wpf/Properties/AssemblyInfo.cs | 4 +- LibVLCSharp.Wpf/VLCHostProvider.cs | 72 +++++++++++++++++++ .../{VLCViewControl.xaml => VideoView.xaml} | 6 +- ...CViewControl.xaml.cs => VideoView.xaml.cs} | 12 +++- LibVLCSharp.sln | 4 +- LibVLCSharp/Shared/MediaPlayer.cs | 5 ++ LibVlcSharp.Wpf.Sample/App.xaml | 4 +- LibVlcSharp.Wpf.Sample/App.xaml.cs | 3 - .../LibVLCSharp.Wpf.Sample.csproj | 8 +-- LibVlcSharp.Wpf.Sample/MainWindow.xaml | 12 ++-- LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs | 19 +++-- .../Properties/AssemblyInfo.cs | 4 +- .../Properties/Resources.Designer.cs | 4 +- .../Properties/Settings.Designer.cs | 2 +- 15 files changed, 127 insertions(+), 42 deletions(-) create mode 100644 LibVLCSharp.Wpf/VLCHostProvider.cs rename LibVLCSharp.Wpf/{VLCViewControl.xaml => VideoView.xaml} (82%) rename LibVLCSharp.Wpf/{VLCViewControl.xaml.cs => VideoView.xaml.cs} (87%) diff --git a/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj index 72627384e..5b0f45c6f 100644 --- a/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj +++ b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj @@ -7,8 +7,8 @@ {DA7A2677-0944-481F-A59B-9128FC54FD5F} Library Properties - LibVLCSharp.Wpf - LibVLCSharp.Wpf + LibVLCSharp.WPF + LibVLCSharp.WPF v4.6.1 512 @@ -48,8 +48,8 @@ - - VLCViewControl.xaml + + VideoView.xaml @@ -59,7 +59,7 @@ - + MSBuild:Compile diff --git a/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs b/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs index 823683a52..ad4b206b4 100644 --- a/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs +++ b/LibVLCSharp.Wpf/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("LibVLCSharp.Wpf")] +[assembly: AssemblyTitle("LibVLCSharp.WPF")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LibVLCSharp.Wpf")] +[assembly: AssemblyProduct("LibVLCSharp.WPF")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LibVLCSharp.Wpf/VLCHostProvider.cs b/LibVLCSharp.Wpf/VLCHostProvider.cs new file mode 100644 index 000000000..5b5c93873 --- /dev/null +++ b/LibVLCSharp.Wpf/VLCHostProvider.cs @@ -0,0 +1,72 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using LibVLCSharp.Shared; + +namespace LibVLCSharp.Wpf +{ + public class VLCHostProvider : IDisposable, INotifyPropertyChanged + { + private MediaPlayer mediaPlayer; + private LibVLC libVLC; + private MediaPlayer.LibVLCVideoFormatCb VideoFormatCb; + private MediaPlayer.LibVLCVideoCleanupCb VideoCleanupCb; + private MediaPlayer.LibVLCVideoDisplayCb VideoDisplayCb; + private MediaPlayer.LibVLCVideoLockCb VideoLockCb; + private MediaPlayer.LibVLCVideoUnlockCb VideoUnlockCb; + + public event PropertyChangedEventHandler PropertyChanged; + + public VLCHostProvider() + { + Core.Initialize(); + libVLC = new LibVLC(); + mediaPlayer = new MediaPlayer(libVLC); + + VideoFormatCb = new MediaPlayer.LibVLCVideoFormatCb(VideoFormat); + VideoCleanupCb =new MediaPlayer.LibVLCVideoCleanupCb(VideoCleanUp); + VideoDisplayCb = new MediaPlayer.LibVLCVideoDisplayCb(VideoDisplay); + VideoLockCb = new MediaPlayer.LibVLCVideoLockCb(VideoLock); + VideoUnlockCb = new MediaPlayer.LibVLCVideoUnlockCb(VideoUnlock); + + mediaPlayer.SetVideoFormatCallbacks(VideoFormatCb, VideoCleanupCb); + mediaPlayer.SetVideoCallbacks(VideoLockCb, VideoUnlockCb, VideoDisplayCb); + } + + + //TODO https://github.com/ZeBobo5/Vlc.DotNet/blob/develop/src/Vlc.DotNet.Wpf/VlcVideoSourceProvider.cs + private uint VideoFormat(ref IntPtr userData, IntPtr chroma, ref uint width, ref uint height, ref uint pitches, ref uint lines) + { + return 0; + } + + private void VideoCleanUp(ref System.IntPtr opaque) + { + + } + + private void VideoDisplay(System.IntPtr opaque, System.IntPtr picture) + { + + } + + private System.IntPtr VideoLock(System.IntPtr opaque, System.IntPtr planes) + { + return IntPtr.Zero; + } + + private void VideoUnlock(System.IntPtr opaque, System.IntPtr picture, System.IntPtr planes) + { + + } + + public void Dispose() + { + mediaPlayer.Dispose(); + libVLC.Dispose(); + } + } +} diff --git a/LibVLCSharp.Wpf/VLCViewControl.xaml b/LibVLCSharp.Wpf/VideoView.xaml similarity index 82% rename from LibVLCSharp.Wpf/VLCViewControl.xaml rename to LibVLCSharp.Wpf/VideoView.xaml index eeba4d789..1910fbc11 100644 --- a/LibVLCSharp.Wpf/VLCViewControl.xaml +++ b/LibVLCSharp.Wpf/VideoView.xaml @@ -1,15 +1,15 @@ - - + diff --git a/LibVLCSharp.Wpf/VLCViewControl.xaml.cs b/LibVLCSharp.Wpf/VideoView.xaml.cs similarity index 87% rename from LibVLCSharp.Wpf/VLCViewControl.xaml.cs rename to LibVLCSharp.Wpf/VideoView.xaml.cs index 2813a4719..a98e1bea7 100644 --- a/LibVLCSharp.Wpf/VLCViewControl.xaml.cs +++ b/LibVLCSharp.Wpf/VideoView.xaml.cs @@ -13,16 +13,16 @@ using System.Windows.Navigation; using System.Windows.Shapes; -namespace LibVLCSharp.Wpf +namespace LibVLCSharp.WPF { - public partial class VLCViewControl : UserControl, LibVLCSharp.Shared.IVideoView + public partial class VideoView : UserControl, LibVLCSharp.Shared.IVideoView, IDisposable { private LibVLCSharp.Shared.MediaPlayer mediaPlayer; private LibVLCSharp.Shared.LibVLC libVLC; private double controlWidth; private double controlHeight; - public VLCViewControl() + public VideoView() { Shared.Core.Initialize(); libVLC = new Shared.LibVLC(); @@ -66,6 +66,12 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) } } + public void Dispose() + { + mediaPlayer.Dispose(); + libVLC.Dispose(); + } + public LibVLCSharp.Shared.MediaPlayer MediaPlayer { get => mediaPlayer; } public LibVLCSharp.Shared.LibVLC LibVLC { get => libVLC; } } diff --git a/LibVLCSharp.sln b/LibVLCSharp.sln index dc20e962c..eedd3ee45 100644 --- a/LibVLCSharp.sln +++ b/LibVLCSharp.sln @@ -35,9 +35,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample.iO EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.Forms.Sample", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.csproj", "{C6E79ABC-C203-4892-848A-FF99CCE53F8A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Wpf.Sample", "LibVlcSharp.Wpf.Sample\LibVLCSharp.Wpf.Sample.csproj", "{01CCB934-B77F-4681-86C5-AE4FEE648238}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF.Sample", "LibVlcSharp.Wpf.Sample\LibVLCSharp.WPF.Sample.csproj", "{01CCB934-B77F-4681-86C5-AE4FEE648238}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Wpf", "LibVLCSharp.Wpf\LibVLCSharp.Wpf.csproj", "{DA7A2677-0944-481F-A59B-9128FC54FD5F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF", "LibVLCSharp.Wpf\LibVLCSharp.WPF.csproj", "{DA7A2677-0944-481F-A59B-9128FC54FD5F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/LibVLCSharp/Shared/MediaPlayer.cs b/LibVLCSharp/Shared/MediaPlayer.cs index 90aad6e5d..28e30b6a1 100644 --- a/LibVLCSharp/Shared/MediaPlayer.cs +++ b/LibVLCSharp/Shared/MediaPlayer.cs @@ -631,6 +631,11 @@ internal static extern int LibVLCMediaPlayerAddSlave(IntPtr mediaPlayer, MediaSl #endif } + public void SetVideoFormatCallbacks() + { + throw new NotImplementedException(); + } + MediaPlayerEventManager _eventManager; /// Create an empty Media Player object diff --git a/LibVlcSharp.Wpf.Sample/App.xaml b/LibVlcSharp.Wpf.Sample/App.xaml index fb82cdc5d..2d1dc7fcc 100644 --- a/LibVlcSharp.Wpf.Sample/App.xaml +++ b/LibVlcSharp.Wpf.Sample/App.xaml @@ -1,7 +1,7 @@ - diff --git a/LibVlcSharp.Wpf.Sample/App.xaml.cs b/LibVlcSharp.Wpf.Sample/App.xaml.cs index d1695692e..03872fb7b 100644 --- a/LibVlcSharp.Wpf.Sample/App.xaml.cs +++ b/LibVlcSharp.Wpf.Sample/App.xaml.cs @@ -8,9 +8,6 @@ namespace LibVlcSharp.Wpf.Sample { - /// - /// Interaktionslogik für "App.xaml" - /// public partial class App : Application { } diff --git a/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj b/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj index eda539503..82286f284 100644 --- a/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj +++ b/LibVlcSharp.Wpf.Sample/LibVLCSharp.Wpf.Sample.csproj @@ -6,8 +6,8 @@ AnyCPU {01CCB934-B77F-4681-86C5-AE4FEE648238} WinExe - LibVLCSharp.Wpf.Sample - LibVLCSharp.Wpf.Sample + LibVLCSharp.WPF.Sample + LibVLCSharp.WPF.Sample v4.6.1 512 {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -93,9 +93,9 @@ - + {da7a2677-0944-481f-a59b-9128fc54fd5f} - LibVLCSharp.Wpf + LibVLCSharp.WPF {d1c3b7c4-713b-46b2-b33a-e9298c819921} diff --git a/LibVlcSharp.Wpf.Sample/MainWindow.xaml b/LibVlcSharp.Wpf.Sample/MainWindow.xaml index 9e347def3..04ac58807 100644 --- a/LibVlcSharp.Wpf.Sample/MainWindow.xaml +++ b/LibVlcSharp.Wpf.Sample/MainWindow.xaml @@ -1,13 +1,13 @@ - - - + Title="LibVLCSharp.WPF.Sample" Height="450" Width="800"> + + diff --git a/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs b/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs index e6f3a4d36..7c00e13d9 100644 --- a/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs +++ b/LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs @@ -14,7 +14,7 @@ using System.Windows.Shapes; using LibVLCSharp.Shared; -namespace LibVLCSharp.Wpf.Sample +namespace LibVLCSharp.WPF.Sample { public partial class MainWindow : Window { @@ -24,9 +24,6 @@ public MainWindow() { InitializeComponent(); - Player.MediaPlayer.Play(new Media(Player.LibVLC, - "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", Media.FromType.FromLocation)); - dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Interval = new TimeSpan(0, 0, 10); dispatcherTimer.Start(); @@ -34,9 +31,17 @@ public MainWindow() private void dispatcherTimer_Tick(object sender, EventArgs e) { - this.Width = 900; - this.Height = 750; - dispatcherTimer.Stop(); + if (!Player.MediaPlayer.IsPlaying) + { + Player.MediaPlayer.Play(new Media(Player.LibVLC, + "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", Media.FromType.FromLocation)); + } + else + { + this.Width = 900; + this.Height = 750; + dispatcherTimer.Stop(); + } } } } \ No newline at end of file diff --git a/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs b/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs index b10c039f6..db693448b 100644 --- a/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs +++ b/LibVlcSharp.Wpf.Sample/Properties/AssemblyInfo.cs @@ -7,11 +7,11 @@ // Allgemeine Informationen über eine Assembly werden über die folgenden // Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, // die einer Assembly zugeordnet sind. -[assembly: AssemblyTitle("LibVLCSharp.Wpf.Sample")] +[assembly: AssemblyTitle("LibVLCSharp.WPF.Sample")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("LibVLCSharp.Wpf.Sample")] +[assembly: AssemblyProduct("LibVLCSharp.WPF.Sample")] [assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs b/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs index db2c59150..9104d375e 100644 --- a/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs +++ b/LibVlcSharp.Wpf.Sample/Properties/Resources.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace LibVLCSharp.Wpf.Sample.Properties { +namespace LibVLCSharp.WPF.Sample.Properties { using System; @@ -39,7 +39,7 @@ internal Resources() { internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LibVLCSharp.Wpf.Sample.Properties.Resources", typeof(Resources).Assembly); + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("LibVLCSharp.WPF.Sample.Properties.Resources", typeof(Resources).Assembly); resourceMan = temp; } return resourceMan; diff --git a/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs b/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs index a5d1c030d..354e9d11b 100644 --- a/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs +++ b/LibVlcSharp.Wpf.Sample/Properties/Settings.Designer.cs @@ -8,7 +8,7 @@ // //------------------------------------------------------------------------------ -namespace LibVLCSharp.Wpf.Sample.Properties { +namespace LibVLCSharp.WPF.Sample.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] From 0f1101266f570e7af226f7903d20b33c63d0877a Mon Sep 17 00:00:00 2001 From: Ch4rg3r Date: Wed, 4 Jul 2018 12:54:36 +0200 Subject: [PATCH 03/13] Change #2 Renaming Folders --- LibVLCSharp.Wpf/VLCHostProvider.cs | 72 ------------------------------ LibVLCSharp.sln | 4 +- 2 files changed, 2 insertions(+), 74 deletions(-) delete mode 100644 LibVLCSharp.Wpf/VLCHostProvider.cs diff --git a/LibVLCSharp.Wpf/VLCHostProvider.cs b/LibVLCSharp.Wpf/VLCHostProvider.cs deleted file mode 100644 index 5b5c93873..000000000 --- a/LibVLCSharp.Wpf/VLCHostProvider.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using LibVLCSharp.Shared; - -namespace LibVLCSharp.Wpf -{ - public class VLCHostProvider : IDisposable, INotifyPropertyChanged - { - private MediaPlayer mediaPlayer; - private LibVLC libVLC; - private MediaPlayer.LibVLCVideoFormatCb VideoFormatCb; - private MediaPlayer.LibVLCVideoCleanupCb VideoCleanupCb; - private MediaPlayer.LibVLCVideoDisplayCb VideoDisplayCb; - private MediaPlayer.LibVLCVideoLockCb VideoLockCb; - private MediaPlayer.LibVLCVideoUnlockCb VideoUnlockCb; - - public event PropertyChangedEventHandler PropertyChanged; - - public VLCHostProvider() - { - Core.Initialize(); - libVLC = new LibVLC(); - mediaPlayer = new MediaPlayer(libVLC); - - VideoFormatCb = new MediaPlayer.LibVLCVideoFormatCb(VideoFormat); - VideoCleanupCb =new MediaPlayer.LibVLCVideoCleanupCb(VideoCleanUp); - VideoDisplayCb = new MediaPlayer.LibVLCVideoDisplayCb(VideoDisplay); - VideoLockCb = new MediaPlayer.LibVLCVideoLockCb(VideoLock); - VideoUnlockCb = new MediaPlayer.LibVLCVideoUnlockCb(VideoUnlock); - - mediaPlayer.SetVideoFormatCallbacks(VideoFormatCb, VideoCleanupCb); - mediaPlayer.SetVideoCallbacks(VideoLockCb, VideoUnlockCb, VideoDisplayCb); - } - - - //TODO https://github.com/ZeBobo5/Vlc.DotNet/blob/develop/src/Vlc.DotNet.Wpf/VlcVideoSourceProvider.cs - private uint VideoFormat(ref IntPtr userData, IntPtr chroma, ref uint width, ref uint height, ref uint pitches, ref uint lines) - { - return 0; - } - - private void VideoCleanUp(ref System.IntPtr opaque) - { - - } - - private void VideoDisplay(System.IntPtr opaque, System.IntPtr picture) - { - - } - - private System.IntPtr VideoLock(System.IntPtr opaque, System.IntPtr planes) - { - return IntPtr.Zero; - } - - private void VideoUnlock(System.IntPtr opaque, System.IntPtr picture, System.IntPtr planes) - { - - } - - public void Dispose() - { - mediaPlayer.Dispose(); - libVLC.Dispose(); - } - } -} diff --git a/LibVLCSharp.sln b/LibVLCSharp.sln index eedd3ee45..401eda2ca 100644 --- a/LibVLCSharp.sln +++ b/LibVLCSharp.sln @@ -35,9 +35,9 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.Forms.Sample.iO EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibVLCSharp.Forms.Sample", "LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample\LibVLCSharp.Forms.Sample.csproj", "{C6E79ABC-C203-4892-848A-FF99CCE53F8A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF.Sample", "LibVlcSharp.Wpf.Sample\LibVLCSharp.WPF.Sample.csproj", "{01CCB934-B77F-4681-86C5-AE4FEE648238}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF.Sample", "LibVlcSharp.WPF.Sample\LibVLCSharp.WPF.Sample.csproj", "{01CCB934-B77F-4681-86C5-AE4FEE648238}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF", "LibVLCSharp.Wpf\LibVLCSharp.WPF.csproj", "{DA7A2677-0944-481F-A59B-9128FC54FD5F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LibVLCSharp.WPF", "LibVLCSharp.WPF\LibVLCSharp.WPF.csproj", "{DA7A2677-0944-481F-A59B-9128FC54FD5F}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution From 7ddc025392caf39ec1277c4f59585b672d88cf8b Mon Sep 17 00:00:00 2001 From: Ch4rg3r Date: Sun, 8 Jul 2018 17:43:13 +0200 Subject: [PATCH 04/13] Updated VideoView for WPF supporting Child Elements Now Supports behaviour like container (example Grid). Child Elements can be added in XAML or code behind and will automatically set to foreground Elements (preventing airspace issue) --- LibVLCSharp.WPF/ForegroundWindow.xaml | 11 ++ LibVLCSharp.WPF/ForegroundWindow.xaml.cs | 106 ++++++++++++++++++ LibVLCSharp.WPF/Styles/VideoView.xaml | 23 ++++ .../VideoView.cs | 25 ++++- LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj | 12 +- LibVLCSharp.Wpf/VideoView.xaml | 17 --- LibVlcSharp.WPF.Sample/Controls.xaml | 13 +++ LibVlcSharp.WPF.Sample/Controls.xaml.cs | 55 +++++++++ LibVlcSharp.WPF.Sample/Example1.xaml | 13 +++ LibVlcSharp.WPF.Sample/Example1.xaml.cs | 29 +++++ LibVlcSharp.WPF.Sample/Example2.xaml | 18 +++ LibVlcSharp.WPF.Sample/Example2.xaml.cs | 55 +++++++++ .../LibVLCSharp.Wpf.Sample.csproj | 18 +++ LibVlcSharp.Wpf.Sample/MainWindow.xaml | 10 +- LibVlcSharp.Wpf.Sample/MainWindow.xaml.cs | 31 ++--- 15 files changed, 389 insertions(+), 47 deletions(-) create mode 100644 LibVLCSharp.WPF/ForegroundWindow.xaml create mode 100644 LibVLCSharp.WPF/ForegroundWindow.xaml.cs create mode 100644 LibVLCSharp.WPF/Styles/VideoView.xaml rename LibVLCSharp.Wpf/VideoView.xaml.cs => LibVLCSharp.WPF/VideoView.cs (70%) delete mode 100644 LibVLCSharp.Wpf/VideoView.xaml create mode 100644 LibVlcSharp.WPF.Sample/Controls.xaml create mode 100644 LibVlcSharp.WPF.Sample/Controls.xaml.cs create mode 100644 LibVlcSharp.WPF.Sample/Example1.xaml create mode 100644 LibVlcSharp.WPF.Sample/Example1.xaml.cs create mode 100644 LibVlcSharp.WPF.Sample/Example2.xaml create mode 100644 LibVlcSharp.WPF.Sample/Example2.xaml.cs diff --git a/LibVLCSharp.WPF/ForegroundWindow.xaml b/LibVLCSharp.WPF/ForegroundWindow.xaml new file mode 100644 index 000000000..4ccb2c34d --- /dev/null +++ b/LibVLCSharp.WPF/ForegroundWindow.xaml @@ -0,0 +1,11 @@ + + + diff --git a/LibVLCSharp.WPF/ForegroundWindow.xaml.cs b/LibVLCSharp.WPF/ForegroundWindow.xaml.cs new file mode 100644 index 000000000..8f961db35 --- /dev/null +++ b/LibVLCSharp.WPF/ForegroundWindow.xaml.cs @@ -0,0 +1,106 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace LibVLCSharp.WPF +{ + internal partial class ForegroundWindow : Window + { + private Window wndhost; + private ContentControl bckgnd; + private UIElement _content; + + internal new UIElement Content + { + get { return _content; } + set + { + _content = value; + if (_content != null) + { + PART_Content.Children.Clear(); + PART_Content.Children.Add(_content); + } + } + } + + internal ForegroundWindow(ContentControl Background) + { + InitializeComponent(); + bckgnd = Background; + bckgnd.Loaded += Bckgnd_Loaded; + bckgnd.Unloaded += Bckgnd_Unloaded; + } + + private void Bckgnd_Unloaded(object sender, RoutedEventArgs e) + { + wndhost.Closing -= Wndhost_Closing; + wndhost.SizeChanged -= Wndhost_SizeChanged; + wndhost.LocationChanged -= Wndhost_LocationChanged; + this.Hide(); + } + + private void Bckgnd_Loaded(object sender, RoutedEventArgs e) + { + wndhost = Window.GetWindow(bckgnd); + this.Owner = wndhost; + wndhost.Closing += Wndhost_Closing; + wndhost.SizeChanged += Wndhost_SizeChanged; + wndhost.LocationChanged += Wndhost_LocationChanged; + try + { + Point locationFromScreen = bckgnd.PointToScreen(new Point(0, 0)); + PresentationSource source = PresentationSource.FromVisual(wndhost); + System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); + this.Left = targetPoints.X; + this.Top = targetPoints.Y; + Vector size = bckgnd.PointToScreen(new Point(bckgnd.ActualWidth, bckgnd.ActualHeight)) - bckgnd.PointToScreen(new Point(0, 0)); + this.Height = size.Y; + this.Width = size.X; + this.Show(); + wndhost.Focus(); + } + catch + { + this.Hide(); + } + } + + private void Wndhost_LocationChanged(object sender, EventArgs e) + { + Point locationFromScreen = bckgnd.PointToScreen(new Point(0, 0)); + PresentationSource source = PresentationSource.FromVisual(wndhost); + System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); + this.Left = targetPoints.X; + this.Top = targetPoints.Y; + } + + private void Wndhost_SizeChanged(object sender, SizeChangedEventArgs e) + { + Point locationFromScreen = bckgnd.PointToScreen(new Point(0, 0)); + PresentationSource source = PresentationSource.FromVisual(wndhost); + System.Windows.Point targetPoints = source.CompositionTarget.TransformFromDevice.Transform(locationFromScreen); + this.Left = targetPoints.X; + this.Top = targetPoints.Y; + Vector size = bckgnd.PointToScreen(new Point(bckgnd.ActualWidth, bckgnd.ActualHeight)) - bckgnd.PointToScreen(new Point(0, 0)); + this.Height = size.Y; + this.Width = size.X; + } + + private void Wndhost_Closing(object sender, System.ComponentModel.CancelEventArgs e) + { + this.Close(); + } + } +} diff --git a/LibVLCSharp.WPF/Styles/VideoView.xaml b/LibVLCSharp.WPF/Styles/VideoView.xaml new file mode 100644 index 000000000..b5765c782 --- /dev/null +++ b/LibVLCSharp.WPF/Styles/VideoView.xaml @@ -0,0 +1,23 @@ + + + + \ No newline at end of file diff --git a/LibVLCSharp.Wpf/VideoView.xaml.cs b/LibVLCSharp.WPF/VideoView.cs similarity index 70% rename from LibVLCSharp.Wpf/VideoView.xaml.cs rename to LibVLCSharp.WPF/VideoView.cs index a98e1bea7..596840a3b 100644 --- a/LibVLCSharp.Wpf/VideoView.xaml.cs +++ b/LibVLCSharp.WPF/VideoView.cs @@ -8,6 +8,7 @@ using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; +using System.Windows.Markup; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; @@ -21,20 +22,37 @@ public partial class VideoView : UserControl, LibVLCSharp.Shared.IVideoView, IDi private LibVLCSharp.Shared.LibVLC libVLC; private double controlWidth; private double controlHeight; + private ForegroundWindow foreground; public VideoView() { + ResourceDictionary res = Application.LoadComponent(new Uri("/LibVLCSharp.WPF;component/Styles/VideoView.xaml", UriKind.RelativeOrAbsolute)) as ResourceDictionary; + this.Style = res["VideoViewStyle"] as Style; + + foreground = new ForegroundWindow(this); + Shared.Core.Initialize(); libVLC = new Shared.LibVLC(); mediaPlayer = new Shared.MediaPlayer(libVLC); - InitializeComponent(); this.SizeChanged += OnSizeChanged; controlHeight = this.Height; controlWidth = this.Width; - mediaPlayer.Hwnd = PlayerView.Handle; + this.Loaded += VideoView_Loaded; + } + + private void VideoView_Loaded(object sender, RoutedEventArgs e) + { + mediaPlayer.Hwnd = ((System.Windows.Forms.Panel)this.Template.FindName("PART_PlayerView", this)).Handle; + + if (this.Content != null) + { + object content = Content; + Content = null; + foreground.Content = (UIElement)content; + } } private void VLCResize() @@ -68,6 +86,9 @@ private void OnSizeChanged(object sender, SizeChangedEventArgs e) public void Dispose() { + if (mediaPlayer.IsPlaying) + mediaPlayer.Stop(); + mediaPlayer.Dispose(); libVLC.Dispose(); } diff --git a/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj index 5b0f45c6f..42674fc83 100644 --- a/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj +++ b/LibVLCSharp.Wpf/LibVLCSharp.Wpf.csproj @@ -47,10 +47,11 @@ - - - VideoView.xaml + + ForegroundWindow.xaml + + @@ -59,7 +60,10 @@ - + + MSBuild:Compile + + MSBuild:Compile diff --git a/LibVLCSharp.Wpf/VideoView.xaml b/LibVLCSharp.Wpf/VideoView.xaml deleted file mode 100644 index 1910fbc11..000000000 --- a/LibVLCSharp.Wpf/VideoView.xaml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/LibVlcSharp.WPF.Sample/Controls.xaml b/LibVlcSharp.WPF.Sample/Controls.xaml new file mode 100644 index 000000000..2f8b2f657 --- /dev/null +++ b/LibVlcSharp.WPF.Sample/Controls.xaml @@ -0,0 +1,13 @@ + + + + + + diff --git a/LibVlcSharp.WPF.Sample/Controls.xaml.cs b/LibVlcSharp.WPF.Sample/Controls.xaml.cs new file mode 100644 index 000000000..3dbedffc1 --- /dev/null +++ b/LibVlcSharp.WPF.Sample/Controls.xaml.cs @@ -0,0 +1,55 @@ +using LibVLCSharp.Shared; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; +using System.Windows.Threading; + +namespace LibVLCSharp.WPF.Sample +{ + public partial class Controls : UserControl + { + Example1 parent; + + public Controls(Example1 Parent) + { + parent = Parent; + + InitializeComponent(); + + PlayButton.Click += PlayButton_Click; + StopButton.Click += StopButton_Click; + } + + private void StopButton_Click(object sender, RoutedEventArgs e) + { + parent.Dispatcher.Invoke(() => { + if (parent.Player.MediaPlayer.IsPlaying) + { + parent.Player.MediaPlayer.Stop(); + } + }); + } + + private void PlayButton_Click(object sender, RoutedEventArgs e) + { + parent.Dispatcher.Invoke(() => { + if (!parent.Player.MediaPlayer.IsPlaying) + { + parent.Player.MediaPlayer.Play(new Media(parent.Player.LibVLC, + "http://www.quirksmode.org/html5/videos/big_buck_bunny.mp4", Media.FromType.FromLocation)); + } + }); + } + } +} diff --git a/LibVlcSharp.WPF.Sample/Example1.xaml b/LibVlcSharp.WPF.Sample/Example1.xaml new file mode 100644 index 000000000..66e3afdae --- /dev/null +++ b/LibVlcSharp.WPF.Sample/Example1.xaml @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/LibVlcSharp.WPF.Sample/Example1.xaml.cs b/LibVlcSharp.WPF.Sample/Example1.xaml.cs new file mode 100644 index 000000000..b65533656 --- /dev/null +++ b/LibVlcSharp.WPF.Sample/Example1.xaml.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace LibVLCSharp.WPF.Sample +{ + public partial class Example1 : Window + { + private Controls controls; + + public Example1() + { + InitializeComponent(); + + controls = new Controls(this); + Player.Content = controls; + } + } +} diff --git a/LibVlcSharp.WPF.Sample/Example2.xaml b/LibVlcSharp.WPF.Sample/Example2.xaml new file mode 100644 index 000000000..db983e5ea --- /dev/null +++ b/LibVlcSharp.WPF.Sample/Example2.xaml @@ -0,0 +1,18 @@ + + + + +