Add Full Screen/Windows Support for MediaElement
#929
Replies: 9 comments 5 replies
-
In MainActivity.cs for Android you could use:
Or if you do not want to save instance state you can use:
For Windows you can use in your Program.cs:
Just remember to put the using statements at top above namespace. I am using this currently to have android and Windows app full screen. The only drawback is the app is always full screen. I have not solved the issue of how to get in and out of full screen so I can navigate properly. I have gesture controls working with swipe right to back to previous page on pages. But on pages with media element active and playing full screen the "ShouldShowPlaybackControls" blocks swipe gestures. But If all you want is full screen the code above will do it. BTW it is deprecated but still works in Android 33.0. It will give you a warning at compile time but it works. |
Beta Was this translation helpful? Give feedback.
-
I have created a workaround to fix this issue here. |
Beta Was this translation helpful? Give feedback.
-
I opened a new discussion for this. I have a working implementation that I have added to media element in a fork of this repo. I am looking for input on adding it media element. I have tested it against my app and I am hoping the team looks at it and gives some advice on how to move forward. It is in New Feature discussion here: #1123 I have made a fork and done the initial work to make:
I have added those functions to media element and added the device specific implementations for windows and android. I am hoping to get feedback on changes that need to be done and/or for people to make comments on how to move forward. Here is a link to forked repo with the additions: https://github.com/ne0rrmatrix/Maui/tree/FullScreen |
Beta Was this translation helpful? Give feedback.
-
I also noticed with IOS apps even the ones by Apple themselves only have full screen at start of video. I think apple limits that and there is no way to do it otherwise. I have no info on Mac, I don't have one or have access to one atm. |
Beta Was this translation helpful? Give feedback.
-
I'd like to ask if there any updates for the full screen mode? |
Beta Was this translation helpful? Give feedback.
-
On MAUI Project in Visual Studio 2022 when I run the project on iOS simulator on the Program.cs under Platforms/iOS folder on below line
it gives below error ObjCRuntime.ObjCException: 'Objective-C exception thrown. Name: UIViewControllerHierarchyInconsistency Reason: child view controller:<AVPlayerViewController: 0x14cdaa200> should have parent view controller:<Microsoft_Maui_Controls_Handlers_Items_CarouselViewController: 0x14bd9aa90> but actual parent is:<Microsoft_Maui_Controls_Platform_Compatibility_ShellFlyoutRenderer: 0x14bd55530> My XAML PAge is like below
I have tried with latest 2.0 version of CommunityToolkit.Maui.MediaElement as well as with 1.0.2 version. It gives error in both version. Can any one help with this? |
Beta Was this translation helpful? Give feedback.
-
Bumping as would be nice to have this feature. In the meantime, I have a low effort partial-fix I'd like to submit for people in the same scenario. It accomplishes what @Tuurash did in his example, but with less steps involved. Note, this does not hide the status bar, but that isn't something I 100% need at the moment so it works for me. I do understand this isn't a full full screen Do the following:
In your ViewModel:
Now each time the full screen button is toggled, the page will appear to fill the screen. You can also add in additional controls as others have done, using the same method |
Beta Was this translation helpful? Give feedback.
-
There is an older discussion that has been closed here - #1123 |
Beta Was this translation helpful? Give feedback.
-
Currently being worked on with #1679 so closing the discussion here to clean up. |
Beta Was this translation helpful? Give feedback.
-
This is being asked a lot. While it seems trivial to add, it actually seems to be a very hard thing to do. Here is a couple of reasons why:
IsFullWindow
, this seems do what we want but I haven't seen it work yet. Also this is a difference in behavior where on mobile the video is ideally showing full screen overlapping everything. That is also how it works on macOS, but then on Windows it seems to only do the full size of the current window, not the entire screen.I'd like to think about and discuss how we can come up with a solution that we can implement for MediaElement so we can bring you full screen/window functionality! Any input is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions