MediaElement full-screen orientation #1945
Replies: 15 comments
-
That is default behavior inherited from android. I opened 3 different media players on android. Youtube, twitch, and Prime Video. The all have the exact same behavior that you describe. I don't see any reason to change that. If the device is rotation locked it should not rotate the video when you change orientation. That is expected and default behavior. If we change this it would require overriding default behavior and I don't think that is a good idea. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the response @ne0rrmatrix. I think there's some confusion here, I don't see any issue with this if the device rotation is being disabled by the user. What looks wrong to me here is preventing the video from adapting to the rotation when I (as a developer) lock the Application to portrait mode (for instance because landscape is not supported for my use-case / UI). I checked Youtube and Prime Video from your examples, and those applications do support both portrait and landscape mode. On IOS for instance, |
Beta Was this translation helpful? Give feedback.
-
Yes I think I am confused. Are you saying that you set orientation lock and the android implementation is staying locked? If you lock orientation in Maui you want the video player specifically to ignore that? I'm not sure exactly what it is you are expecting? |
Beta Was this translation helpful? Give feedback.
-
I just double-checked and when screen rotation is locked the video does not rotate in Android in a video player by default. I loaded the sample app from repo in portrait mode in both android and iOS. Both exhibit the same behavior. If I lock rotation from the menu it stays in that rotation for the whole time screen rotation is locked. edit for clarity: I opened the sample app from the Maui Community toolkit. Not the provided sample. Sorry about the any possible confusion. I am now going to do further testing with the provided sample to see the behavior. |
Beta Was this translation helpful? Give feedback.
-
There are two ways to lock the application in portrait mode, by two different actors:
Now, if you try YouTube app on an Android phone. there's no way to use it in landscape mode besides entering video fullscreen mode while watching a landscape video (if the video has portrait proportions, the full screen will remain in portrait mode). Let's say I want to create a YouTube clone. That said, I want my users to be able to tap on the fullscreen button in the video player, and:
|
Beta Was this translation helpful? Give feedback.
-
Ok. That wouuld be easy to implement as I already have an idea how to do that. Sorry about the confusion. I would be happy to submit a proposal to add the ability to do force rotation like that as an option for developers. I will talk to a team member this morning. |
Beta Was this translation helpful? Give feedback.
-
Awesome, thank you @ne0rrmatrix! |
Beta Was this translation helpful? Give feedback.
-
I just checked both my phone and android tablet. The behavior of the device is not as you describe. If I turn on auto rotation in settings it will auto rotate based on orientation in YouTube. This is default behavior of most video apps on Samsung devices. This works for both full screen and not full screen. I am going to start working on suggested change to allow developers a choice to lock this behavior based on choice. It will be a developer option and not a default behavior. Edit: I will create a discussion to have the team and community discuss it. I have not yet started working on it. |
Beta Was this translation helpful? Give feedback.
-
I have the same case, my app is Portrait for everything but 1 page (the one with MediaElement) so I just add some android specific code in OnAppearing and OnDisappearing so change only when enter the page and leave the one who have before changed when leave the page. I just see @ne0rrmatrix have a OnFullscreenButtonClick method mentioned but I don´t know atm how to access it, but I´m guessing that method will be a better place to put the code I´m refereing. Hopefully this will not be needed at all when a better solution founded but maybe works for some people in the meantime.
|
Beta Was this translation helpful? Give feedback.
-
Is the discussion setting already ?? I can´t find any. |
Beta Was this translation helpful? Give feedback.
-
I just add in "Nice to have" a way to know if the FullScreen button is clicked or a flag to know if MediaElement is on FullScreen/Normal, atm just have OnSizeAllocated but don´t help that much without the flag/method |
Beta Was this translation helpful? Give feedback.
-
Just for reference related: #1748 (comment) |
Beta Was this translation helpful? Give feedback.
-
Feel free to create a discussion to start getting the ball rolling @Neotrickster |
Beta Was this translation helpful? Give feedback.
-
Thanks man |
Beta Was this translation helpful? Give feedback.
-
@vhugogarcia I think this one can be moved to a discussion? |
Beta Was this translation helpful? Give feedback.
-
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
If Android is locked in Portrait mode, MediaElement full-screen won't rotate the video horizontally.
See example video
Expected Behavior
Regardless of orientation lock, a video should follow the screen orientation when full-screen.
Steps To Reproduce
With
ScreenOrientation = ScreenOrientation.Portrait
Link to public reproduction project repository
https://github.com/armanimichael/MediaElementFullScreen
Environment
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions