Repository navigation
Labels
Description
Current behavior
MediaPlayer does not work on Windows-arm64.
Consider this Debug build and run:
git clone https://github.com/unoplatform/uno.chefs.git
cd uno.chefs
git checkout d54bceea13406bca23e870a89ecee469813c69b3
dotnet build -f net9.0-desktop Chefs\Chefs.csproj
.\Chefs\bin\Debug\net9.0-desktop\Chefs.exedotnet is 10.0.202.
After launching the app:
- Click Skip
- Click Sign in with Apple
- Click Avocado Toast (or any other recipe)
- Click 🥕 Start Cooking!
No video is shown.
Console output contains:
fail: Uno.UI.Dispatching.NativeDispatcher[0]
NativeDispatcher unhandled exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> LibVLCSharp.Shared.VLCException: Failed to load required native libraries.
Have you installed the latest LibVLC package from nuget for your target platform?
Search paths include Z:\Developer\src\unoplatform\Uno.Chefs\Chefs\bin\Debug\net9.0-desktop\libvlc\win-x64\libvlc.dll,Z:\Developer\src\unoplatform\Uno.Chefs\Chefs\bin\Debug\net9.0-desktop\libvlc\win-x64\libvlccore.dll; Z:\Developer\src\unoplatform\Uno.Chefs\Chefs\bin\Debug\net9.0-desktop\libvlc\win-x64\libvlc.dll,Z:\Developer\src\unoplatform\Uno.Chefs\Chefs\bin\Debug\net9.0-desktop\libvlc\win-x64\libvlccore.dll; Z:\Developer\src\unoplatform\Uno.Chefs\Chefs\bin\Debug\net9.0-desktop\libvlc.dll,
at LibVLCSharp.Shared.Core.LoadLibVLC(String libvlcDirectoryPath)
at LibVLCSharp.Shared.Core.InitializeDesktop(String libvlcDirectoryPath)
at LibVLCSharp.Shared.Helpers.MarshalUtils.CreateWithOptions(String[] options, Func`3 create)
at LibVLCSharp.Shared.LibVLC.<>c__DisplayClass8_0.<.ctor>b__0()
at LibVLCSharp.Shared.Internal..ctor(Func`1 create, Action`1 release)
at LibVLCSharp.Shared.LibVLC..ctor(String[] options)
at Uno.UI.MediaPlayer.Skia.Win32.SharedMediaPlayerExtension..ctor(MediaPlayer player)
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
--- End of inner exception stack trace ---
at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
at System.Reflection.MethodBaseInvoker.InvokeWithOneArg(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
at Uno.UI.Runtime.Skia.Win32.Win32Host.<>c__DisplayClass5_0.<.cctor>b__18(MediaPlayer player)
at Uno.Foundation.Extensibility.ApiExtensibility.<>c__DisplayClass3_0`1.<Register>b__0(Object o) in C:\a\1\s\src\Uno.Foundation\Extensibility\ApiExtensibility.cs:line 52
at Uno.Foundation.Extensibility.ApiExtensibility.CreateInstance[T](Object owner, T& instance) in C:\a\1\s\src\Uno.Foundation\Extensibility\ApiExtensibility.cs:line 85
at Windows.Media.Playback.MediaPlayer.Initialize() in C:\a\1\s\src\Uno.UWP\Media\Playback\MediaPlayer.others.cs:line 27
at Windows.Media.Playback.MediaPlayer..ctor() in C:\a\1\s\src\Uno.UWP\Media\Playback\MediaPlayer.cs:line 94
at Microsoft.UI.Xaml.Controls.MediaPlayerElement.OnApplyTemplate() in C:\a\1\s\src\Uno.UI\UI\Xaml\Controls\MediaPlayerElement\MediaPlayerElement.cs:line 393
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 292
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Uno.Toolkit.UI.AutoLayout.MeasureOverride(Size availableSize)
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Uno.Toolkit.UI.AutoLayout.MeasureOverride(Size availableSize)
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Uno.Toolkit.UI.AutoLayout.MeasureOverride(Size availableSize)
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.Controls.Control.MeasureOverride(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\Controls\Control\Control.cs:line 484
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.Controls.ContentPresenter.MeasureOverride(Size size) in C:\a\1\s\src\Uno.UI\UI\Xaml\Controls\ContentPresenter\ContentPresenter.cs:line 1259
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.Controls.Control.MeasureOverride(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\Controls\Control\Control.cs:line 484
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.Layout.crossruntime.cs:line 170
at Uno.UI.Xaml.Islands.XamlIslandRoot.MeasureOverride(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\Internal\Islands\XamlIslandRoot.Core.cs:line 54
at Microsoft.UI.Xaml.FrameworkElement.InnerMeasureCore(Size availableSize) in C:\a\1\s\src\Uno.UI\UI\Xaml\FrameworkElement.Layout.crossruntime.cs:line 333
at Microsoft.UI.Xaml.UIElement.UpdateLayout() in C:\a\1\s\src\Uno.UI\UI\Xaml\UIElement.cs:line 793
at Uno.UI.Xaml.Core.CoreServices.OnTick() in C:\a\1\s\src\Uno.UI\UI\Xaml\Internal\CoreServices.cs:line 103
at Uno.UI.Dispatching.NativeDispatcher.RunAction(NativeDispatcher dispatcher, Action action) in C:\a\1\s\src\Uno.UI.Dispatching\Native\NativeDispatcher.cs:line 141
Expected behavior
On the left-hand side of the app, a video should play.
Compare to macOS:
dotnet build -f net9.0-desktop Chefs/Chefs.csproj
./Chefs/bin/Debug/net9.0-desktop/Chefs
Note: requires that .NET 9.0 be installed, even when building with .NET 10, in order to avoid:
% ./Chefs/bin/Debug/net9.0-desktop/Chefs
You must install or update .NET to run this application.
App: /Users/jon/Developer/src/unoplatform/Uno.Chefs/Chefs/bin/Debug/net9.0-desktop/Chefs
Architecture: arm64
Framework: 'Microsoft.NETCore.App', version '9.0.0' (arm64)
.NET location: /usr/local/share/dotnet
The following frameworks were found:
10.0.5 at [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Learn more:
https://aka.ms/dotnet/app-launch-failed
To install missing framework, download:
https://aka.ms/dotnet-core-applaunch?framework=Microsoft.NETCore.App&framework_version=9.0.0&arch=arm64&rid=osx-arm64&os=osx.26
How to reproduce it (as minimally and precisely as possible)
Environment
- Visual Studio 2022 (version: )
- Visual Studio 2022 for Mac (version: )
- Visual Studio Code (version: )
- Rider Windows
- Rider macOS
- Rider Linux
Nuget Package(s)
Uno Version(s)
- Uno.Sdk Version: 6.4.53 (what's currently used in main), and this also happens with 6.6.0-dev.222.
Affected platform(s)
- iOS
- Android
- WebAssembly
- WebAssembly renders for Xamarin.Forms
- Windows
- Desktop
- Build tasks
Relevant plugins
- Resharper (version: )
Anything else we need to know?
Reacted by Copilot
Activity
[-]Video playback fails on Windows[/-][+]Video playback fails on Windows-arm64[/+]jonpryor commentedon Apr 28, 2026
This appears to be a "win-arm64" issue. Which in turn means it's a "bump all the things" issue.
For starters, when building with the "default" Uno.Sdk 6.4.53 (because that's what main currently uses), the VideoLan.LibVLC.Windows 3.0.21 NuGet Package is used, which doesn't even contain arm64 support. (It's from 2024-Sep-16.
Updating
global.jsonto instead target6.6.0-dev.222in turn bumps the VideoLan.LibVLC.Windows version to 3.0.23.1, which does have arm64 binaries:(Behold!
libvlc\win-arm64\libvlc.dll!)Unfortunately, getting an arm64 version of
libvlc.dllinto the output directory is only half the problem.The other half of the problem is loading the correct
libvlc.dll. That in turn requires this change to LibVLCSharp: videolan/libvlcsharp@e1b93f8The above fix is part of LibVLCSharp 3.9.7 and later.
Unfortunately Uno.UI.MediaPlayer.Skia.Win32 explicitly references LibVLCSharp 3.7.0 -- from 2023-04-04 -- which predates the fix in videolan/libvlcsharp@e1b93f8a by 3 years.
"Obviously," to support MediaPlayer on win-arm64, we need to update Uno to reference a newer version of LibVLCSharp.
I attempted to "force" use of a newer version in Chefs:
but this fails to build:
[-]Video playback fails on Windows-arm64[/-][+]MediaPlayer fails on Windows-arm64[/+]