Multiple issues with VLC on Xamarin.Forms
I'm having multiple issues with VLC on Xamarin.Forms largely due to its lacking documentation.
- Full Screen Doesn't work at all.
- The Control Icons often don't render correctly or not at all.
- Screen Rotation doesn't work as expected.
I've followed the VLC Samples which got me this far, but still not getting any level of consistency or intuitiveness with the VLC library.
Also, the reason I say the documentation is lacking is for things like the Font.otf files that the platform needs (and crashes without it) but is not shown anywhere. I only found them in the samples.
Note: I'm troubleshooting with the sample and project repositories. On the iPhone 6s+ (iOS 3.6), only in DarkMode. On the iPhone Xs Max (iOS 3.5.1), the Icons seem to work on both projects, only in DarkMode. On the iPhone 11 (iOS 3.5.1), the Icons seem to work on both projects, only in DarkMode. With Any device, if Visual is set to anything other than the default, it breaks the control GUI/Icons.
Minimal project and steps to reproduce
See this Repository
After opening the solution:
- Go to 'App.xaml.cs'
- Use either 'MainPage =' lines. comment out the line not in use. You might also want to comment/uncomment 'Visual = new VisualMarker.DefaultVisual()' lines on the 'VideoPlayerPage' file.
- Start the app and Play video.
- See error
What is the current bug behavior?
Full Screen Doesn't work at all. If no input is given, the background does go away on Android but the rest of the frame gets bigger too, especially on Shell. When LibVLCSharp.Forms.Shared.MediaPlayerElement.MediaPlayer.Fullscreen is set, nothing occurs.
The Control Icons often don't render correctly or not at all. I finally got it to show correctly on iOS somehow once, but now it stopped. Android sometimes shows only half the icon, leaving the rest barely visible. After further digging, it seems to be related to Xamarin.Forms.Visual.Material libraries: when adding the following to the ContentPage constructor:
• Visual = new VisualMarker.MaterialVisual(); // icon issues
• Visual = new VisualMarker.DefaultVisual(); // intermittent issues, if Visual is set anywhere in the app, such as the Xamarin.Forms.Shell class.
Screen Rotation doesn't work as expected. I've had to either of things occur when you rotate the screen:
• A grey bar appears on the bottom as if allocating room for the controls and will usually shrink the video view, but no controls show up.
• The VideoView gets cut off and only shows half the video, I've tried multiple things but nothing changes.
What is the expected correct behavior?
Full Screen Doesn't work at all. when LibVLCSharp.Forms.Shared.MediaPlayerElement.MediaPlayer.Fullscreen is set, I expect a popup or something to come up to display the video full screen.
The Control Icons often don't render correctly or not at all. The controls just render and work.
Screen Rotation doesn't work as expected. The LibVLCSharp.Forms.Shared.MediaPlayerElement view rotates and fills the screen like any other view in Xamarin.Forms instead of getting cut off, or a random grey bar showing up which makes the video really small.
Does it work on other platforms? Does it work with the official VLC apps?
Relevant logs and/or screenshots
The Icon Issue.
- OS: iOS 13.6, Android Q (10)
- Version iOS 13.6, Android Q (10)
- Device: iPhone 6s+, Note 10+
- LibVLC version and architecture 3.4.6 Xamarin.Forms.iOS/Android
- LibVLCSharp version 8.0