diff --git a/LibVLCSharp.Avalonia/LibVLCSharp.Avalonia.csproj b/LibVLCSharp.Avalonia/LibVLCSharp.Avalonia.csproj deleted file mode 100644 index f001765..0000000 --- a/LibVLCSharp.Avalonia/LibVLCSharp.Avalonia.csproj +++ /dev/null @@ -1,25 +0,0 @@ - - - LibVLCSharp.Avalonia - Avalonia integration for LibVLCSharp - LibVLCSharp is a cross-platform audio and video API for .NET platforms based on VideoLAN's LibVLC Library. It provides a comprehensive multimedia API that can be used across mobile, server and desktop to render video and output audio. Mono, .NET Framework and .NET Core runtimes are supported. - -LibVLCSharp.Avalonia contains the integration with Avalonia. -This package contains the views that allows to display a video played with LibVLCSharp -in a Avalonia app. - -This package depends on LibVLCSharp as well as Avalonia. - -LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. - - net6.0 - LibVLCSharp.Avalonia - LibVLCSharp.Avalonia - $(PackageTags);avalonia - - - - - - - diff --git a/LibVLCSharp.Avalonia/README.md b/LibVLCSharp.Avalonia/README.md deleted file mode 100644 index f57824e..0000000 --- a/LibVLCSharp.Avalonia/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# LibVLCSharp.Avalonia - -The official [Avalonia](https://github.com/AvaloniaUI/Avalonia) views for [LibVLCSharp](../LibVLCSharp/README.md). - -This package contains the views that allows to display a video played with [LibVLCSharp](../LibVLCSharp/README.md) -in an Avalonia app. - -This package depends on [LibVLCSharp](../LibVLCSharp/README.md) as well as [Avalonia](https://github.com/AvaloniaUI/Avalonia). - -Supported frameworks: - -- netstandard2.0 - -Supported platforms: - -- Windows -- MacOS -- Linux diff --git a/LibVLCSharp.Avalonia/VideoView.cs b/LibVLCSharp.Avalonia/VideoView.cs deleted file mode 100644 index 541523d..0000000 --- a/LibVLCSharp.Avalonia/VideoView.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Avalonia; -using Avalonia.Controls; -using Avalonia.Data; -using Avalonia.Platform; -using LibVLCSharp.Shared; - -namespace LibVLCSharp.Avalonia -{ - /// - /// Avalonia VideoView for Windows, Linux and Mac. - /// - public class VideoView : NativeControlHost - { - private IPlatformHandle? _platformHandle = null; - private MediaPlayer? _mediaPlayer = null; - - /// - /// MediaPlayer Data Bound property - /// - /// - /// Defines the property. - /// - public static readonly DirectProperty MediaPlayerProperty = - AvaloniaProperty.RegisterDirect( - nameof(MediaPlayer), - o => o.MediaPlayer, - (o, v) => o.MediaPlayer = v, - defaultBindingMode: BindingMode.TwoWay); - - /// - /// Gets or sets the MediaPlayer that will be displayed. - /// - public MediaPlayer? MediaPlayer - { - get { return _mediaPlayer; } - set - { - if (ReferenceEquals(_mediaPlayer, value)) - { - return; - } - - Detach(); - _mediaPlayer = value; - Attach(); - } - } - - private void Attach() - { - if(_mediaPlayer == null || _platformHandle == null || !IsInitialized) - return; - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - _mediaPlayer.Hwnd = _platformHandle.Handle; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - _mediaPlayer.XWindow = (uint)_platformHandle.Handle; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - _mediaPlayer.NsObject = _platformHandle.Handle; - } - } - - private void Detach() - { - if (_mediaPlayer == null) - return; - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - _mediaPlayer.Hwnd = IntPtr.Zero; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - _mediaPlayer.XWindow = 0; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - _mediaPlayer.NsObject = IntPtr.Zero; - } - } - - /// - protected override IPlatformHandle CreateNativeControlCore(IPlatformHandle parent) - { - _platformHandle = base.CreateNativeControlCore(parent); - - if (_mediaPlayer == null) - return _platformHandle; - - Attach(); - - return _platformHandle; - } - - /// - protected override void DestroyNativeControlCore(IPlatformHandle control) - { - Detach(); - - base.DestroyNativeControlCore(control); - - if (_platformHandle != null) - { - _platformHandle = null; - } - } - } -} diff --git a/LibVLCSharp.Avalonia/nuget.config b/LibVLCSharp.Avalonia/nuget.config deleted file mode 100644 index 2215f14..0000000 --- a/LibVLCSharp.Avalonia/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - -