CommunityToolkit / CommunityToolkit/Maui
[BUG] MediaElement (video) inside Popup on Android has multiple issues
- Dominant language
- C#
- Stars
- 2.7k
- Forks
- 500
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Did you read the "Reporting a bug" section on Contributing file?
- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug
### Current Behavior
I am noticing several issues when trying to have a video open within a Popup (on Android):
1) When opening with its initial size, playback works, but interaction with the playback control (pause/resume) is a bit janky. This will cause the video to stutter and intermittently disappear. This does not happen if MediaElement is directly on a page. (this might be an issue with the emulator, though I'm unsure)
2) When going fullscreen, the Popup is now in front of the MediaElement, as already pointed out in [this issue](https://github.com/CommunityToolkit/Maui/issues/2606). I assumed this had already been solved, but apparently not.
3) With default Popup-settings and in fullscreen-mode, any attempt to interact with the playback controls will be treated as clicking outside the Popup, causing it to close.
4) If this Popup-behavior is disabled by setting ` CanBeDismissedByTappingOutsideOfPopup = false`, it still does not work. Because now the fullscreen videoplayer can no longer be interacted with. Tapping the screen no longer brings up playback controls. So no way to exit fullscreen-mode either. Without a dedicated close-button (or auto-close on MediaEnded) you're stuck at this point.
### Expected Behavior
I consider problem 3) to be expected behavior, 1), 2) and 4) certainly not.
Problem 2) in particular is problematic because the issue was raised before, but now it's closed yet unresolved.
I would expect two controls from the CommunityToolkit to work well together, specifically in an MVVM-setup.
If this particular setup has known limitations, it should be documented somewhere.
If there is a proper workaround (i.e. NOT in code-behind) I would love to hear it!
### Steps To Reproduce
1. Open and run the solution from [this reproduction repository](https://github.com/AdalbertKhoolsaat/MauiAndroidMediaElementInPopupIssue)
2. Default setup can be used to check problems 1, 2 and 4.
By changing the PopupOptions in MainPageVM, one can observe 'problem' 3 where trying to interact with the fullscreen player is treated as tapping outside the popup.
### Link to public reproduction project repository
https://github.com/AdalbertKhoolsaat/MauiAndroidMediaElementInPopupIssue
### Environment
```markdown
- .NET MAUI CommunityToolkit: 14.0.1
- .NET MAUI CommunityToolkit MediaElement: 8.0.1
- .NET MAUI: 10.0.100
- OS: Android 15.0 (API 35)
```
### Anything else?
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.