diff --git a/README.md b/README.md index 38392460d..43fc48475 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,8 @@ LibVLCSharp is the .NET wrapper that consumes `LibVLC` and allows you to interac | Xamarin.iOS | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] | | Xamarin.tvOS | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] | | Xamarin.Mac | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] | -| UWP | [LibVLCSharp](src/LibVLCSharp/README.md) | [![LibVLCSharpBadge]][LibVLCSharp] | +| UWP | [LibVLCSharp.UWP][RLibVLCSharpUWP] | [![LibVLCSharpUWPBadge]][LibVLCSharpUWP] | +| WinUI | [LibVLCSharp.WinUI][RLibVLCSharpWinUI] | [![LibVLCSharpWinUIBadge]][LibVLCSharpWinUI] | | Xamarin.Forms | [LibVLCSharp.Forms][RLibVLCSharpForms] | [![LibVLCSharpFormsBadge]][LibVLCSharpForms] | | MAUI | [LibVLCSharp.MAUI][RLibVLCSharpMAUI] | [![LibVLCSharpMAUIBadge]][LibVLCSharpMAUI] | | WPF | [LibVLCSharp.WPF][RLibVLCSharpWPF] | [![LibVLCSharpWPFBadge]][LibVLCSharpWPF] | @@ -159,6 +160,8 @@ See the docs for [preview builds installation details](docs/libvlc_preview.md). [RLibVLCSharpGTK]: src/LibVLCSharp.GTK/README.md [RLibVLCSharpFormsGTK]: src/LibVLCSharp.Forms.Platforms.GTK/README.md [RLibVLCSharpWinForms]: src/LibVLCSharp.WinForms/README.md +[RLibVLCSharpUWP]: src/LibVLCSharp.UWP/README.md +[RLibVLCSharpWinUI]: src/LibVLCSharp.WinUI/README.md [RLibVLCSharpUno]: src/LibVLCSharp.Uno/README.md [RLibVLCSharpAvalonia]: src/LibVLCSharp.Avalonia/README.md [RLibVLCSharpEto]: src/LibVLCSharp.Eto/README.md @@ -183,6 +186,10 @@ See the docs for [preview builds installation details](docs/libvlc_preview.md). [LibVLCSharp]: https://www.nuget.org/packages/LibVLCSharp/ [LibVLCSharpBadge]: https://img.shields.io/nuget/v/LibVLCSharp.svg +[LibVLCSharpUWP]: https://www.nuget.org/packages/LibVLCSharp.UWP/ +[LibVLCSharpUWPBadge]: https://img.shields.io/nuget/v/LibVLCSharp.UWP.svg +[LibVLCSharpWinUI]: https://www.nuget.org/packages/LibVLCSharp.WinUI/ +[LibVLCSharpWinUIBadge]: https://img.shields.io/nuget/v/LibVLCSharp.WinUI.svg [LibVLCSharpForms]: https://www.nuget.org/packages/LibVLCSharp.Forms/ [LibVLCSharpFormsBadge]: https://img.shields.io/nuget/v/LibVLCSharp.Forms.svg diff --git a/buildsystem/azure-pipelines.yml b/buildsystem/azure-pipelines.yml index 5e54ff6a9..0c8f8ef21 100644 --- a/buildsystem/azure-pipelines.yml +++ b/buildsystem/azure-pipelines.yml @@ -27,7 +27,7 @@ stages: - job: Windows timeoutInMinutes: 120 pool: - vmImage: 'windows-latest' + vmImage: 'windows-2025-vs2026' steps: - template: windows-build.yml @@ -85,4 +85,4 @@ stages: command: custom custom: 'cake' arguments: --target CIDeploy - workingDirectory: buildsystem \ No newline at end of file + workingDirectory: buildsystem diff --git a/buildsystem/base-template.yml b/buildsystem/base-template.yml index 3b73a1dec..373b38b9f 100644 --- a/buildsystem/base-template.yml +++ b/buildsystem/base-template.yml @@ -3,7 +3,7 @@ steps: displayName: 'Use .NET Core SDK' inputs: packageType: sdk - version: 10.0.100 + version: 10.0.300 - bash: | dotnet workload install android @@ -23,6 +23,34 @@ steps: script: | Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer" $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" + if (-not (Test-Path $InstallPath)) { + Write-Host "Visual Studio 2022 Enterprise is not installed. Installing it for legacy Xamarin targets." + $Arguments = @( + '/c', + 'vs_installer.exe', + 'install', + '--channelUri', + 'https://aka.ms/vs/17/release/channel', + '--productId', + 'Microsoft.VisualStudio.Product.Enterprise', + '--installPath', + "`"$InstallPath`"", + '--add', + 'Component.Xamarin', + '--quiet', + '--norestart', + '--nocache' + ) + $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden + if ($process.ExitCode -ne 0 -and $process.ExitCode -ne 3010) { + Write-Error "Failed to install Visual Studio 2022 Xamarin components (exit code: $($process.ExitCode))" + exit 1 + } + + Write-Host "Visual Studio 2022 Xamarin components installed successfully" + return + } + $componentsToAdd = @("Component.Xamarin") [string]$workloadArgs = $componentsToAdd | ForEach-Object { " --add " + $_ } $Arguments = @('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $workloadArgs, '--quiet', '--norestart', '--nocache') diff --git a/buildsystem/build.cake b/buildsystem/build.cake index c13f7f502..e97e284a3 100644 --- a/buildsystem/build.cake +++ b/buildsystem/build.cake @@ -25,6 +25,8 @@ var libraryProjects = new string[] "../src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj", "../src/LibVLCSharp.WinForms/LibVLCSharp.WinForms.csproj", "../src/LibVLCSharp.WPF/LibVLCSharp.WPF.csproj", + "../src/LibVLCSharp.UWP/LibVLCSharp.UWP.csproj", + "../src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj", }; var testCsproj = "../src/LibVLCSharp.Tests/LibVLCSharp.Tests.csproj"; @@ -33,7 +35,7 @@ var isCiBuild = BuildSystem.AzurePipelines.IsRunningOnAzurePipelines; var suffixVersion = $"alpha-{DateTime.Today.ToString("yyyyMMdd")}-{BuildSystem.AzurePipelines.Environment.Build.Id}"; var feedzLVSSource = "https://f.feedz.io/videolan/preview/nuget/index.json"; var FEEDZ = "FEEDZ"; -const uint totalPackageCount = 12; +const uint totalPackageCount = 14; ////////////////////////////////////////////////////////////////////// // PREPARATION @@ -133,7 +135,7 @@ void Build(string project) settings.WithProperty("VersionSuffix", suffixVersion); } - settings.ToolVersion = MSBuildToolVersion.VS2022; + settings.ToolVersion = MSBuildToolVersion.VS2026; MSBuild(project, settings); } diff --git a/buildsystem/windows-build.yml b/buildsystem/windows-build.yml index d4ee886a7..e05370626 100644 --- a/buildsystem/windows-build.yml +++ b/buildsystem/windows-build.yml @@ -1,5 +1,18 @@ steps: - template: base-template.yml + +- task: PowerShell@2 + displayName: 'Show Visual Studio and MSBuild' + inputs: + targetType: 'inline' + script: | + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + & $vswhere -all -products * -format table + $vsPath = & $vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath + Write-Host "Resolved Visual Studio path: $vsPath" + & "$vsPath\MSBuild\Current\Bin\MSBuild.exe" -version + dotnet --info + - task: PowerShell@2 displayName: 'Install gtksharp' inputs: @@ -224,4 +237,4 @@ steps: - task: PublishBuildArtifacts@1 inputs: pathToPublish: 'nugets' - artifactName: 'nugets' \ No newline at end of file + artifactName: 'nugets' diff --git a/samples/LibVLCSharp.Android.Sample/LibVLCSharp.Android.Sample.csproj b/samples/LibVLCSharp.Android.Sample/LibVLCSharp.Android.Sample.csproj index ffec26df9..777687791 100644 --- a/samples/LibVLCSharp.Android.Sample/LibVLCSharp.Android.Sample.csproj +++ b/samples/LibVLCSharp.Android.Sample/LibVLCSharp.Android.Sample.csproj @@ -1,5 +1,14 @@  + + + Enterprise + Professional + Community + C:\Program Files\Microsoft Visual Studio\2022\$(VS2022Edition) + $(VS2022Root)\MSBuild + $(VS2022Root)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\ + Debug AnyCPU @@ -102,4 +111,4 @@ - \ No newline at end of file + diff --git a/samples/LibVLCSharp.UWP.Sample/LibVLCSharp.UWP.Sample.csproj b/samples/LibVLCSharp.UWP.Sample/LibVLCSharp.UWP.Sample.csproj index 321ede9e7..1b14dbb91 100644 --- a/samples/LibVLCSharp.UWP.Sample/LibVLCSharp.UWP.Sample.csproj +++ b/samples/LibVLCSharp.UWP.Sample/LibVLCSharp.UWP.Sample.csproj @@ -173,9 +173,9 @@ - - {d1c3b7c4-713b-46b2-b33a-e9298c819921} - LibVLCSharp + + {d3b33e0e-2bc1-46ef-a483-6587b9a086a3} + LibVLCSharp.UWP @@ -195,4 +195,4 @@ --> - \ No newline at end of file + diff --git a/samples/LibVLCSharp.WinUI.Sample/LibVLCSharp.WinUI.Sample.csproj b/samples/LibVLCSharp.WinUI.Sample/LibVLCSharp.WinUI.Sample.csproj index 76f84519a..1bc40b0ea 100644 --- a/samples/LibVLCSharp.WinUI.Sample/LibVLCSharp.WinUI.Sample.csproj +++ b/samples/LibVLCSharp.WinUI.Sample/LibVLCSharp.WinUI.Sample.csproj @@ -38,6 +38,6 @@ - + diff --git a/samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/LibVLCSharp.MAUI.Sample.MediaElement.csproj b/samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/LibVLCSharp.MAUI.Sample.MediaElement.csproj index 06c2681a9..68015acbc 100644 --- a/samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/LibVLCSharp.MAUI.Sample.MediaElement.csproj +++ b/samples/MAUI/LibVLCSharp.MAUI.Sample.MediaElement/LibVLCSharp.MAUI.Sample.MediaElement.csproj @@ -52,11 +52,10 @@ - - \ No newline at end of file + diff --git a/src/Directory.Build.props b/src/Directory.Build.props index beec5b391..c6083e7b8 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -22,10 +22,10 @@ $(DefineConstants);ANDROID - + $(DefineConstants);UWP;WINDOWS_MODERN - + $(DefineConstants);WINUI;WINDOWS_MODERN diff --git a/src/LibVLCSharp.MAUI/LibVLCSharp.MAUI.csproj b/src/LibVLCSharp.MAUI/LibVLCSharp.MAUI.csproj index c60e20565..ee23d1b95 100644 --- a/src/LibVLCSharp.MAUI/LibVLCSharp.MAUI.csproj +++ b/src/LibVLCSharp.MAUI/LibVLCSharp.MAUI.csproj @@ -23,7 +23,8 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. - + + diff --git a/src/LibVLCSharp.UWP/LibVLCSharp.UWP.csproj b/src/LibVLCSharp.UWP/LibVLCSharp.UWP.csproj new file mode 100644 index 000000000..be3964841 --- /dev/null +++ b/src/LibVLCSharp.UWP/LibVLCSharp.UWP.csproj @@ -0,0 +1,52 @@ + + + LibVLCSharp.UWP + UWP integration for LibVLCSharp + LibVLCSharp.UWP contains the UWP VideoView integration for LibVLCSharp. + +This package contains the core LibVLCSharp APIs and the UWP view that allows to display video played with LibVLCSharp in a UWP app. + +LibVLC needs to be installed separately, see VideoLAN.LibVLC.UWP. + uap10.0.18362 + $(TargetFrameworks);net9.0-windows10.0.26100;net10.0-windows10.0.26100 + {D3B33E0E-2BC1-46EF-A483-6587B9A086A3} + LibVLCSharp + LibVLCSharp + LibVLCSharp.UWP + $(PackageTags);uwp + true + false + true + win-x86;win-x64;win-arm64 + .NETCoreApp + true + true + + + + 10.0.19041.0 + + + + + + + + Designer + MSBuild:Compile + + + + + + + + + + + + + + + + diff --git a/src/LibVLCSharp.UWP/README.md b/src/LibVLCSharp.UWP/README.md new file mode 100644 index 000000000..68bfca4f8 --- /dev/null +++ b/src/LibVLCSharp.UWP/README.md @@ -0,0 +1,11 @@ +# LibVLCSharp.UWP + +[![NuGet Stats](https://img.shields.io/nuget/v/LibVLCSharp.UWP.svg)](https://www.nuget.org/packages/LibVLCSharp.UWP) +[![NuGet Stats](https://img.shields.io/nuget/dt/LibVLCSharp.UWP.svg)](https://www.nuget.org/packages/LibVLCSharp.UWP) + +The official UWP view for [LibVLCSharp](../LibVLCSharp/README.md). + +This package contains the core LibVLCSharp APIs and the UWP `VideoView` control. + +> BE CAREFUL: This project does not include **LibVLC** itself. Install `VideoLAN.LibVLC.UWP` separately. + diff --git a/src/LibVLCSharp.UWP/XamlMetaDataProvider.cs b/src/LibVLCSharp.UWP/XamlMetaDataProvider.cs new file mode 100644 index 000000000..7ca1c81b3 --- /dev/null +++ b/src/LibVLCSharp.UWP/XamlMetaDataProvider.cs @@ -0,0 +1,26 @@ +using System; + +#if WINUI +using Microsoft.UI.Xaml.Markup; +#else +using Windows.UI.Xaml.Markup; +#endif + +namespace LibVLCSharp.LibVLCSharp_XamlTypeInfo +{ + /// + /// Exposes XAML metadata under the namespace expected from the LibVLCSharp assembly name. + /// + public sealed partial class XamlMetaDataProvider : IXamlMetadataProvider + { + readonly IXamlMetadataProvider _provider = (IXamlMetadataProvider)Activator.CreateInstance( + Type.GetType("LibVLCSharp.LibVLCSharp_UWP_XamlTypeInfo.XamlMetaDataProvider, LibVLCSharp") + ?? throw new InvalidOperationException("Could not find the generated UWP XAML metadata provider."))!; + + IXamlType IXamlMetadataProvider.GetXamlType(Type type) => _provider.GetXamlType(type); + + IXamlType IXamlMetadataProvider.GetXamlType(string fullName) => _provider.GetXamlType(fullName); + + XmlnsDefinition[] IXamlMetadataProvider.GetXmlnsDefinitions() => _provider.GetXmlnsDefinitions(); + } +} diff --git a/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj b/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj index 9374368c3..484ff0c3a 100644 --- a/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj +++ b/src/LibVLCSharp.Uno/LibVLCSharp.Uno.csproj @@ -27,7 +27,8 @@ It also contains a VLC MediaPlayerElement for the Uno Platform (UWP, Android, iO - + + diff --git a/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj b/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj new file mode 100644 index 000000000..fc74fa476 --- /dev/null +++ b/src/LibVLCSharp.WinUI/LibVLCSharp.WinUI.csproj @@ -0,0 +1,44 @@ + + + LibVLCSharp.WinUI + WinUI integration for LibVLCSharp + LibVLCSharp.WinUI contains the WinUI VideoView integration for LibVLCSharp. + +This package contains the core LibVLCSharp APIs and the WinUI view that allows to display video played with LibVLCSharp in a WinUI app. + +LibVLC needs to be installed separately, see VideoLAN.LibVLC.Windows. + net6.0-windows10.0.17763.0;net8.0-windows10.0.19041;net9.0-windows10.0.19041;net10.0-windows10.0.19041 + {1377EBAF-FAB8-45DD-A65F-4C304FF72165} + LibVLCSharp + LibVLCSharp + LibVLCSharp.WinUI + $(PackageTags);winui + true + false + true + true + win-x86;win-x64;win-arm64 + $(NoWarn);NU1510 + $(WarningsNotAsErrors);NU1510 + .NETCoreApp + + + + + + + + Designer + MSBuild:Compile + + + + + + + + + + + + diff --git a/src/LibVLCSharp.WinUI/README.md b/src/LibVLCSharp.WinUI/README.md new file mode 100644 index 000000000..5af164e7c --- /dev/null +++ b/src/LibVLCSharp.WinUI/README.md @@ -0,0 +1,11 @@ +# LibVLCSharp.WinUI + +[![NuGet Stats](https://img.shields.io/nuget/v/LibVLCSharp.WinUI.svg)](https://www.nuget.org/packages/LibVLCSharp.WinUI) +[![NuGet Stats](https://img.shields.io/nuget/dt/LibVLCSharp.WinUI.svg)](https://www.nuget.org/packages/LibVLCSharp.WinUI) + +The official WinUI view for [LibVLCSharp](../LibVLCSharp/README.md). + +This package contains the core LibVLCSharp APIs and the WinUI `VideoView` control. + +> BE CAREFUL: This project does not include **LibVLC** itself. Install `VideoLAN.LibVLC.Windows` separately. + diff --git a/src/LibVLCSharp.WinUI/XamlMetaDataProvider.cs b/src/LibVLCSharp.WinUI/XamlMetaDataProvider.cs new file mode 100644 index 000000000..bdcb5a870 --- /dev/null +++ b/src/LibVLCSharp.WinUI/XamlMetaDataProvider.cs @@ -0,0 +1,21 @@ +using System; +using Microsoft.UI.Xaml.Markup; + +namespace LibVLCSharp.LibVLCSharp_XamlTypeInfo +{ + /// + /// Exposes XAML metadata under the namespace expected from the LibVLCSharp assembly name. + /// + public sealed partial class XamlMetaDataProvider : IXamlMetadataProvider + { + readonly IXamlMetadataProvider _provider = (IXamlMetadataProvider)Activator.CreateInstance( + Type.GetType("LibVLCSharp.LibVLCSharp_WinUI_XamlTypeInfo.XamlMetaDataProvider, LibVLCSharp") + ?? throw new InvalidOperationException("Could not find the generated WinUI XAML metadata provider."))!; + + IXamlType IXamlMetadataProvider.GetXamlType(Type type) => _provider.GetXamlType(type); + + IXamlType IXamlMetadataProvider.GetXamlType(string fullName) => _provider.GetXamlType(fullName); + + XmlnsDefinition[] IXamlMetadataProvider.GetXmlnsDefinitions() => _provider.GetXmlnsDefinitions(); + } +} diff --git a/src/LibVLCSharp.slnx b/src/LibVLCSharp.slnx index baec4b061..5ae8db948 100644 --- a/src/LibVLCSharp.slnx +++ b/src/LibVLCSharp.slnx @@ -482,6 +482,21 @@ + + + + + + + + + + + + + + + diff --git a/src/LibVLCSharp/LibVLCSharp.csproj b/src/LibVLCSharp/LibVLCSharp.csproj index aa4946307..0bcf6c0d9 100644 --- a/src/LibVLCSharp/LibVLCSharp.csproj +++ b/src/LibVLCSharp/LibVLCSharp.csproj @@ -23,21 +23,19 @@ This package also contains the views for the following platforms: - iOS - Mac - tvOS -- UWP If you need Xamarin.Forms support, see LibVLCSharp.Forms. LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. netstandard2.1;netstandard2.0;netstandard1.1;net40;net471;net6.0;net8.0;net9;net10.0 $(TargetFrameworks);net9.0-android;net9.0-ios;net9.0-macos;net9.0-tvos;net10.0-android;net10.0-ios - $(TargetFrameworks);uap10.0.18362;net6.0-windows10.0.17763.0;net8.0-windows10.0.19041;net9.0-windows10.0.19041;net10.0-windows10.0.19041;monoandroid81;xamarin.ios10;xamarin.mac20 + $(TargetFrameworks);monoandroid81;xamarin.ios10;xamarin.mac20 Debug;Release;Win32Debug;Win32Release $(TargetsForTfmSpecificBuildOutput);IncludeAWindow LibVLCSharp LibVLCSharp true false - win-x86;win-x64;win-arm64 .NETCoreApp @@ -45,13 +43,6 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. netstandard2.1;netstandard2.0;net6.0;net6.0-windows - - true - 10.0.19041.0 - - - true - @@ -79,19 +70,6 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. - - - - - Designer - MSBuild:Compile - - - - - - - @@ -116,4 +94,4 @@ LibVLC needs to be installed separately, see VideoLAN.LibVLC.* packages. - \ No newline at end of file + diff --git a/src/LibVLCSharp/README.md b/src/LibVLCSharp/README.md index 5358cb2b3..5f364624c 100644 --- a/src/LibVLCSharp/README.md +++ b/src/LibVLCSharp/README.md @@ -26,6 +26,6 @@ See the [Installation](../../README.md#installation) documentation for more info If you are in one of these situation, this package is made for you. - You want to build a console application that leverages the power of VLC for transcoding/streaming/recording/playing audio... without displaying the video anywhere -- You want to build a Xamarin.iOS/Android/Mac/tvOS/UWP app (not Xamarin.Forms, for that, see [LibVLCSharp.Forms](../LibVLCSharp.Forms/README.md) ) +- You want to build a Xamarin.iOS/Android/Mac/tvOS app (not Xamarin.Forms, for that, see [LibVLCSharp.Forms](../LibVLCSharp.Forms/README.md) ) -For other platforms, see the [main documentation](../../README.md) \ No newline at end of file +For other platforms, see the [main documentation](../../README.md)