Conversation
Improved the previous VideoPlayer UserControl hack and made it more reusable.
|
Hi, Thanks for the PR. I'm not sure about this change though. The idea of this sample is to show a minimal implementation of the VideoView and keep it as simple and straightforward as possible. Real apps can build on this and add their own abstractions, but it's sort of out of scope for this repo. We have more complete samples here https://github.com//mfkl/libvlcsharp-samples if you'd like to contribute a more featured avalonia mediaplayer sample. Additionally, your code removes the autoplay functionality and the controls overlay on hover. Media URL indeed seems to be invalid, and it could be updated for all samples. |
|
Ok I can see how having F12 could be helpful but I also try to limit unnecessary breaking changes. UserControl support was added in 8a5257b which could indeed be a nicer user experience if we provide it out of the box. Could this be done without breaking the existing VideoView API tho? |




Improved the previous LibVLCSharp.Avalonia.Samples VideoPlayer hack and made it more reusable.
Description of Change
-Transformed VideoPlayer into a more reusable component with it's own MediaPlayer DirectProperty that takes ownership of VideoView.MediaPlayerProperty (...but does taking ownership even matter!?)
-The .axml now defines a ControlTemplate where VideoView's MediaPlayer and Content are TemplateBinded
-Removed any reference to a ViewModel in the VideoPlayer
-Now it is possible to set the overlay directly on VideoPlayer instead of VideoView
Note: VideoPlayer pointer events don't trigger, but we can wire them like this if really needed:
VideoPlayer.axml:
VideoPlayer.axml.cs:
This could also be integrated into the library:
-VideoPlayer would become the new VideoView
-The old VideoView would become NativeVideoView
Issues Resolved
None
API Changes
None
Platforms Affected
None
Behavioral/Visual Changes
None
Before/After Screenshots
Not applicable
Testing Procedure
PR Checklist