LibVLCSharp issueshttps://code.videolan.org/videolan/LibVLCSharp/-/issues2024-03-04T10:10:35Zhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/635Build errors when targeting Windows SDK versions2024-03-04T10:10:35ZBarrett LewisBuild errors when targeting Windows SDK versions### Summary
Including LibVLCSharp in an x86/64 project with a **versioned** windows sdk `<TargetFramework>`, along with windows forms enabled, causes the following errors:
```
Error NETSDK1082 There was no runtime pack for Microsoft.Wi...### Summary
Including LibVLCSharp in an x86/64 project with a **versioned** windows sdk `<TargetFramework>`, along with windows forms enabled, causes the following errors:
```
Error NETSDK1082 There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm-aot'.
Error NETSDK1082 There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm'.
```
When ARM is not used or referenced in the project.
Specifically, I have found that there is a combination of 3 things, that when are the case together, lead to the errors:
1. LibVLCSharp (3.8.2, and some previous) is loaded in the project through Nuget
2. Target framework is _net6.0-windows10.0.19041.0_ (or _net6.0-windows10.0.17763_).
3. `<UseWindowsForms>true</UseWindowsForms>` in the csproj.
If (only) any two of the three is the case, the build succeeds:
- LibVLCSharp works with the desired target framework, until UseWindowsForms is added.
- LibVLCSharp works with UseWindowsForms on _net6.0-windows_, until it's changed to _net6.0-windows10.0.XYZ_.
- The desired target framework works with UseWindowsForms, until LibVLCSharp is added.
It seems that the LibVLCSharp package has some kind of msbuild target setup for this combination of factors that requires an arm runtime/workload installed
Adding `<RuntimeIdentifier>win-x64</RuntimeIdentifier>` does not resolve the issue.
I have tried multiple build environments with the same results.
I primarily work in windows/x86 and troubleshooting cross platform build configurations is not my forte, or I would try to dig deeper.
### Minimal project and steps to reproduce
Start with a blank project with arbitrary main() boilerplate.
- Add LibVLCSharp
- Enable windows forms
- Use a versioned windows SDK target framework
- Try to build.
Sample:
https://code.videolan.org/BarrettLewis/build-issue
NOTE: I started with a functional application using LibVLC (and company), encountered this error when switching target frameworks, and then stripped it down to 10 lines of csproj to repro the issue, that is why other packages like VideoLAN.LibVLC.Windows, LibVLC.Forms, etc, are not linked. This is the bare minimum to get the error.
Functionality can be toggled by (for example) removing the csproj line to enable windows forms. In my case I have to close VS, clear the `bin` and `obj` folders and restart vs. Then it will build until the missing piece of the unholy trinity is added back.
### What is the current *bug* behavior?
Build fails, complaining about missing ARM workload which is not being used.
### What is the expected *correct* behavior?
Build succeeds, does not require ARM workload to build x86/64
### Environment
<!-- Please complete the following information. -->
- OS: Windows
- Version 10 21H2
- Device: PC
- LibVLC version and architecture 3.0.20 (doesn't matter)
- LibVLCSharp version 3.8.2, x64 (desired)
- Visual Studio 2022 17.8.3
- MSBuild version 17.8.3https://code.videolan.org/videolan/LibVLCSharp/-/issues/555VideoView Background is very unstable from LibVLCSharp.WPF2023-02-21T07:30:30ZGhost UserVideoView Background is very unstable from LibVLCSharp.WPFYou can see this video, The VideoView control's background is unstable.
When I click the button **more than 20 times** to open the VLC control, the background of the control sometimes doesn't render black, but some other color.
I just ...You can see this video, The VideoView control's background is unstable.
When I click the button **more than 20 times** to open the VLC control, the background of the control sometimes doesn't render black, but some other color.
I just opened the VLC control and I didn't play any video. So the problem is not due to playing the video.
I didn't set any background color for the VLC control, so its background color should always be black by default.
![001](/uploads/b1d1743efa027b36709b9a710af6afac/001.mp4)
Full Test C# code
.NET 6.0 With Visual studio 2022 (With LibVLCSharp.WPF 3.6.6)
MainWindow.xaml
```
<Window x:Class="VLCTransparentWindowTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:VLCTransparentWindowTest"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="MainWindow" Height="450" Width="800">
<Grid>
<Button Content="Button" Margin="318,166,350,206" Click="Button_Click"/>
</Grid>
</Window>
```
MainWindow.xaml.cs
```
using System.Windows;
namespace VLCTransparentWindowTest
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
var window = new TestWindow();
window.ShowDialog();
}
}
}
```
TestWindow.xaml
```
<Window x:Class="VLCTransparentWindowTest.TestWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:VLC="clr-namespace:LibVLCSharp.WPF;assembly=LibVLCSharp.WPF"
mc:Ignorable="d" WindowStartupLocation="CenterScreen"
Title="TestWindow" Height="400" Width="600" Background="Black">
<Grid>
<VLC:VideoView x:Name="player" x:FieldModifier="private">
</VLC:VideoView>
</Grid>
</Window>
```
TestWindow.xaml.cs
```
using System.Windows;
namespace VLCTransparentWindowTest
{
public partial class TestWindow : Window
{
public TestWindow()
{
InitializeComponent();
}
}
}
```https://code.videolan.org/videolan/LibVLCSharp/-/issues/535Add support to hosting the WPF VideoView in a Windows Forms app with HwndSource2022-04-19T03:16:25ZTimothy PageAdd support to hosting the WPF VideoView in a Windows Forms app with HwndSource### Summary
I try to use a WPF User control containing VideoView on an Element Host on a Windows Form and get an Assertion failed LibVLCSharp.WPF.ForegroundWindow.Background_Loaded dialog box.
### Minimal project and steps to reproduce...### Summary
I try to use a WPF User control containing VideoView on an Element Host on a Windows Form and get an Assertion failed LibVLCSharp.WPF.ForegroundWindow.Background_Loaded dialog box.
### Minimal project and steps to reproduce
Here is a link to my very basic stripped down code to reproduce the issue - (https://github.com/timepage/WPFUserControlWinForm.git)
1. Open the solution file that I have provided
2. Run the solution
3. See error
### What is the current *bug* behavior?
Running the code displays an Assertion failed LibVLCSharp.WPF.ForegroundWindow.Background_Loaded dialog box
### What is the expected *correct* behavior?
I expect to have my WinForm use a WPF user control to display the VideoView to display video.
### Does it work on other plaforms? Does it work with the official VLC apps?
---- Assert Long Message ----
```
at LibVLCSharp.WPF.ForegroundWindow.Background_Loaded(Object sender, RoutedEventArgs e)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root)
at MS.Internal.LoadedOrUnloadedOperation.DoWork()
at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(Object obj)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WPFUserControlWinForm.Program.Main() in C:\Users\timp\Desktop\Dev\WPFUserControlWinForm\WPFUserControlWinForm\Program.cs:line 13
```
### Relevant LibVLC logs and/or screenshots
### Environment
<!-- Please complete the following information. -->
- OS: Windows 10 Enterprise
- Version 19044.1466
- Device: Desktop
- LibVLC version and architecture VideoLAN.LibVLC.Windows 3.0.16
- LibVLCSharp version 3.6.5
- LibVLCSharp.WPF version 3.6.5
- Visual Studio version 2019
### Possible fixeshttps://code.videolan.org/videolan/LibVLCSharp/-/issues/524WPF: support ScrollViewer controls2022-04-07T06:05:22Z紫紫WPF: support ScrollViewer controls<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by "bug" label and verify the issue you're about to submit isn't a duplicate.
If you are using LibVLCSharp commercially, please...<!---
Please read this!
Before opening a new issue, make sure to search for keywords in the issues
filtered by "bug" label and verify the issue you're about to submit isn't a duplicate.
If you are using LibVLCSharp commercially, please consider purchasing a Commercial License: https://videolabs.io/solutions/libvlcsharp
If this is a question please ask on StackOverflow: https://stackoverflow.com/questions/tagged/libvlcsharp.
Need professional support? Reach out at dotnet@videolabs.io for more info.
--->
### Summary
Make scrollviewer play nice with videoview.
### Minimal project and steps to reproduce
[libvlc-wpf-test](https://code.videolan.org/afunc233/libvlc-wpf-test)
<!-- How one can reproduce the issue - this is very important
Provide a Minimal, Complete, and Verifiable example (https://stackoverflow.com/help/mcve) through a git hosting platform
and post the URL here. Do NOT paste parts of your code in the GitLab issue, share your full (but minimal) code through a git repository.
If you don't provide this, we may not be able to help and may close the issue.
Please also provide the functional steps to reproduce the behavior (if necessary):
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
-->
### What is the current *bug* behavior?
when videoview in ScrollViewer and Scroll it to the place where videoView should be hidden,however ForegroundWindow is not clipped
<!-- What actually happens -->
### What is the expected *correct* behavior?
wish ForegroundWindow is clipped or other air-space solution
<!-- What you should see instead -->
<!-- Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise. -->
### Relevant logs and/or screenshots
![144047854-7647ebb9-61f2-47d9-9c18-2862dcb1eb36](/uploads/ecef1c485d59a52e53d1672afc2c6255/144047854-7647ebb9-61f2-47d9-9c18-2862dcb1eb36.png)
<!-- Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise. -->
### Environment
<!-- Please complete the following information. -->
- OS: Windows 10 <!-- [e.g. iOS] -->
- Version 10\.0.19042 Build 19042 <!-- [e.g. 22] -->
- Device: PC <!-- [e.g. iPhone6] -->
- LibVLC version and architecture : newest<!-- [e.g. 3.0.6, x64] -->
- LibVLCSharp version : newest <!-- [e.g. 0.7.0] -->
### Possible fixes
maybe we can use window.Clip Property , But I haven't succeeded,Still trying
<!-- If you can, link to the line of code that might be responsible for the problem -->https://code.videolan.org/videolan/LibVLCSharp/-/issues/521Consider overriding WinForms' CreateHandle/DestroyHandle2021-11-24T02:15:05ZJérémy VIGNELLESConsider overriding WinForms' CreateHandle/DestroyHandleThe WinForms control currently makes use of `ISupportInitialize` to attach the media player's HWND, but there are a few drawbacks:
- An empty BeginInit() method, just because it's an interface implementation
- Doesn't call Detach() when...The WinForms control currently makes use of `ISupportInitialize` to attach the media player's HWND, but there are a few drawbacks:
- An empty BeginInit() method, just because it's an interface implementation
- Doesn't call Detach() when the control is destroyed
I've just came through these methods, and I'm wondering if that could help us:
- https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.createhandle?view=windowsdesktop-6.0
- https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.destroyhandle?view=windowsdesktop-6.0
The suggested change could look like this:
```cs
protected override void CreateHandle()
{
base.CreateHandle();
Attach();
}
protected override void DestroyHandle()
{
Detach();
base.DestroyHandle();
}
```
What do you think ?https://code.videolan.org/videolan/LibVLCSharp/-/issues/454Add MSIX support2023-05-19T08:35:37ZFranck EAdd MSIX supportPackaging with MSIX - WPF - LibVLCSharp.Shared.VLCException: 'Failed to load required native libraries
RE StackOverflow question [here](https://stackoverflow.com/questions/66935123/c-sharp-wpf-vlc-libvlcsharp-shared-vlcexception-failed-...Packaging with MSIX - WPF - LibVLCSharp.Shared.VLCException: 'Failed to load required native libraries
RE StackOverflow question [here](https://stackoverflow.com/questions/66935123/c-sharp-wpf-vlc-libvlcsharp-shared-vlcexception-failed-to-load-required-na/66936116?noredirect=1#comment118328158_66936116)
I am using with minimal sample, which I then prepare for the Windows store following official documentation [here](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/modernize-wpf-tutorial-5)
Issue is that the libvlc folder is not being copied to AppX\... folder.
Minimal project included, and to make the solution small, packages are not installed. List of required packages:
LibVLCSharp.3.5.0
LibVLCSharp.WPF.3.5.0
VideoLAN.LibVLC.Windows.3.0.12
The other packages should only be dependencies.
[vlc-msix-app.zip](/uploads/00ae31e9ffc15bcf6bc8e1223e011c4e/vlc-msix-app.zip)https://code.videolan.org/videolan/LibVLCSharp/-/issues/366Add FileInfo and StorageFile Media ctor API2020-08-13T11:58:08ZMartin FinkelAdd FileInfo and StorageFile Media ctor API### Problem to solve
Add additional helper method to create a Media.
### Intended users
Vlc.Dotnet migrating.
Any libvlcsharp user### Problem to solve
Add additional helper method to create a Media.
### Intended users
Vlc.Dotnet migrating.
Any libvlcsharp userhttps://code.videolan.org/videolan/LibVLCSharp/-/issues/272MediaPlayerElement for UWP2020-04-26T14:45:23ZMartin FinkelMediaPlayerElement for UWP### Problem to solve
Provide a MediaPlayerElement for UWP
### Intended users
UWP devs
### Proposal
The MediaPlayerElement code from Uno by Stéphane should be about 100% re-usable on UWP standalone apps. The tricky part to figure out...### Problem to solve
Provide a MediaPlayerElement for UWP
### Intended users
UWP devs
### Proposal
The MediaPlayerElement code from Uno by Stéphane should be about 100% re-usable on UWP standalone apps. The tricky part to figure out is how to organize the code, to provide good long term maintainability by re-using as much as possible, while not creating a dependency hell and keeping namespaces that make sense...
- Move most of the code from Uno to a shared project.
Or
- Move most of the code from Uno to the LibVLCSharp package (LibVLCSharp/Platforms/UWP).
Unsure what is the best yet. Either way, this is for internal code re-use purposes. The Uno package will remain and this move should not affect end users.
The SuspensionHelper needs to be made crossplatform friendly outside of the Uno scope.
### Documentation
Improve general MediaPlayerElement Documentation.https://code.videolan.org/videolan/LibVLCSharp/-/issues/147C++/WinRT support2020-06-08T11:09:15ZMartin FinkelC++/WinRT supportCurrently the UAP build cannot be easily referenced in a C++ project.
Maybe include a winmd in the nuget.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/target-winmdobj-compiler-option
https://stack...Currently the UAP build cannot be easily referenced in a C++ project.
Maybe include a winmd in the nuget.
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-options/target-winmdobj-compiler-option
https://stackoverflow.com/questions/18694947/how-can-i-make-my-managed-nuget-package-support-c-cli-projectshttps://code.videolan.org/videolan/LibVLCSharp/-/issues/138Xamarin.Forms support for UWP2021-08-31T08:23:46ZMartin FinkelXamarin.Forms support for UWP### Problem to solve
Support UWP for Xamarin.Forms apps
### Intended users
LibVLCSharp.Forms users
### Proposal
Close to getting it working at https://github.com/mfkl/libvlcsharp/tree/uap-xf but:
- Retrieving the swapchain CLI optio...### Problem to solve
Support UWP for Xamarin.Forms apps
### Intended users
LibVLCSharp.Forms users
### Proposal
Close to getting it working at https://github.com/mfkl/libvlcsharp/tree/uap-xf but:
- Retrieving the swapchain CLI options to give to libvlc through the Xamarin Forms abstraction layer is PITA and makes for an awkward API.
- Currently, due to Xamarin.Forms handling of native views, sharpdx initialization fails because the videoView is not fully loaded and sized. It needs to be worked around. This needs to be fixed for libvlc 3.x Xamarin.Forms UWP support.
- Note that Xamarin.Forms does not support uap10.0 target, so we actually need 2 uap builds of libvlcsharp.
With libvlc 4.0 (nightlies), we would not need this hackery because we'd not need the swapchain options. But
- ~~There is no setup for nightlies build to be pushed on myget/nuget~~. edit: there is now.
- Those would be unstable builds.
- We'd need to implement d3d11/gl callbacks for this to work and adapt it with the swapchain.https://code.videolan.org/videolan/LibVLCSharp/-/issues/67WPF video view is "invisible" when HorizontalAlignment and/or VerticalAlignme...2019-03-26T09:18:35ZtexasdiazWPF video view is "invisible" when HorizontalAlignment and/or VerticalAlignment properties are set.If I try to center my video object within a container (Grid, StackPanel, etc...) by performing the following:
```
<vlc:VideoView Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="vlcPlayer" Pan...If I try to center my video object within a container (Grid, StackPanel, etc...) by performing the following:
```
<vlc:VideoView Grid.Column="0" Grid.Row="0" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="vlcPlayer" Panel.ZIndex="1"/>
```
the video object is invisible. I can hear the audio of the video playing, but no video is ever shown. In order to make the video appear again, I have to remove the alignment properties.
Is this a known issue, or future feature option?
-Danny