Add support for NativeControlHost inside a UserControl
See original GitHub issueIs your feature request related to a problem? Please describe.
It seems the native window handle is not surfaced when the NativeControlHost
is positioned inside a UserControl
.
Describe the solution you’d like
Essentially a more advanced version of https://github.com/AvaloniaUI/Avalonia/blob/master/samples/interop/NativeEmbedSample/EmbedSample.cs
Being able to do so would improve the NativeControlHost
support and help building native-based reusable components.
Describe alternatives you’ve considered
Other than that, the view is working fine on its own https://code.videolan.org/videolan/LibVLCSharp/-/blob/3.x/src/LibVLCSharp.Avalonia/VideoView.cs
Additional context
Issue Analytics
- State:
- Created 2 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
c# - AvaloniaUI: Cannot embed VideoView control ...
So that, on Github I created 2 repositories to share and show how to: Embed LibVLCSharp Avalonia VLC VideoView in Avalonia Window (AvaVLCWindow) ......
Read more >Embedding Native (Windows and Linux) Views/Controls ...
This article describes embedding native Windows and Linux control into an Avalonia application.
Read more >UserControls
Right click the folder in Solution Explorer that you'd like to add the control to · Select the Add -> New Item menu...
Read more >UserControl.Content Property (System.Windows.Controls)
This following example creates a UserControl called NameReporter that asks for a name of a person, and reports it back to the user....
Read more >Create a New View
In the Solution Explorer locate and right-click the Views folder. · Click Add and then New Item · Click Avalonia under C# Items...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All the links updated (latest libs and samples versions)
Avalonia Unofficial LibVLCSharp Links
VLC video player inside an Avalonia Window/UserControl embedding single static customizable control (e.g.player buttons) LibVLCSharp.Avalonia.Unofficial
VLC video player inside an Avalonia Window/UserControl embedding multiple draggable customizable controls (e.g.player buttons, images,…) LibVLCSharp.Avalonia.Unofficial.UCanvas
LibVLCSharp.Avalonia.Unofficial Samples LibVLCSharp.Avalonia.Unofficial.Samples
LibVLCSharp.Avalonia.Unofficial.UCanvas sample LibVLCSharp.Avalonia.Unofficial.UCanvas.Samples
YAMP 2 - Open source video player sample using LibVLCSharp.Avalonia.Unofficial library Github sources Watch YAMP2 in action
New test on Raspberry Pi (DietPi with MATE or Xfce)
It works fine!
Transparency and Opacity are fully honored.
In my opinion, the problem is not Avalonia vs Raspberry, the problem is what is installed or not in Raspberry.
With DietPi OS and MATE (or Xfce) as X, the sample works perfectly. And playback is smooth without jerks, interruptions or whatever.
As root, I installed
libx11-dev, libvlc-dev and vlc
, copied the published sample (built in Windows 10 withdotnet publish -c release -f net5.0 -r linux-arm
),chmod 777 the whole folder content
and ran the sample. It has to be ran as root or with sudo.