Handling Fullscreen Mode in Media Element #1748
Replies: 6 comments 11 replies
-
There was a fix merged today that should address one of these issues. The full screen button now respects showing/hiding controls settings. So if you create custom controls and hide default controls the full screen controls will be hidden too. This was fixed/merged yesterday. If you set custom controls now and disable default controls full screen controls should be disabled and not visible. We are looking into the possibility of adding controls that will specifically allow a developer to set full screen in code behind. The only issue with that currently is it would be Windows/Android only. This is because the method used to set full screen in IOS/Mac is a hidden method that is not in UIKit. Or at least the version that is exposed in Maui. This was mentioned in monthly toolkit meeting on youtube. I hope to hear more about with someone creating a proposal with changes. |
Beta Was this translation helpful? Give feedback.
-
This one will be awesome, I have an App using portrait mode only but 1 window (the one with MediaPlayer) and I "unlock" landscape mode on appearing on "lock" on dissapearing but logic when the user toggles fullscreen will be ideal to avoid weird interactions. |
Beta Was this translation helpful? Give feedback.
-
In regards to each question I will respond as to what is currently possible and what issue may be involved in supporting each idea.
|
Beta Was this translation helpful? Give feedback.
-
API that allows developers to hook a media element event and know the full screen status. Is it full screen or normal? Example API: /// <summary>
/// Backing store for the <see cref="FullScreenState"/> property.
/// </summary>
public static readonly BindableProperty FullScreenProperty =
BindableProperty.Create(nameof(FullScreenState), typeof(MediaElementScreenState), typeof(MediaElement),
MediaElementScreenState.Default, propertyChanged: OnFullScreenPropertyChanged); Example usage: public MediaElementPage(MediaElementViewModel viewModel, ILogger<MediaElementPage> logger) : base(viewModel)
{
InitializeComponent();
MediaElement.FullScreenStateChanged += MediaElement_FullScreenStateChanged;
}
void MediaElement_FullScreenStateChanged(object? sender, FullScreenStateChangedEventArgs e) =>
logger.LogInformation("FullScreen State Changed. Old State: {PreviousState}, New State: {NewState}", e.PreviousState, e.NewState); |
Beta Was this translation helpful? Give feedback.
-
Before I migrate to MAUI MediaElement I was using Xamarin with Xamarians/MediaPlayer [https://github.com/Xamarians/MediaPlayer] , looks simple enough from a use perspective:
I don´t know if that´s better or no but I hope it helps. As a mater of fact, this player keep working until today (Xamarin) on android and stop working on iOS 16 but the project was abandoned long long time ago so migrate into MAUI MediaElement was just a life saver |
Beta Was this translation helpful? Give feedback.
-
Would it be possible to add support to enter full screen from code? |
Beta Was this translation helpful? Give feedback.
-
Greetings to the Community,
I've been integrating the
MediaElement
control into my application and am impressed with its capabilities and performance. I want to extend my gratitude to the contributors and community for this valuable resource.Discussion Points on Fullscreen Functionality
I have a few points regarding the fullscreen feature of the
MediaElement
that I'd like to discuss and seek advice on:Event Handling for Fullscreen Mode: Is there a way to tap into events specifically for entering and exiting fullscreen mode? I'm looking to implement additional logic when the user toggles fullscreen on a video.
Custom Controls in Fullscreen: In fullscreen mode, I've observed that custom controls disappear. Is this expected? How can I ensure that my custom video controls are still available and functional when the video is in fullscreen mode?
Hiding the Default Fullscreen Toggle: For specific project requirements, I need to manage fullscreen mode programmatically without the default fullscreen toggle button. Is there a procedure to hide this button or disable it, or to programmatically go fullscreen?
Looking forward to any suggestions, workarounds, or guidance you can provide!
Beta Was this translation helpful? Give feedback.
All reactions