Open vikher opened 1 month ago
There is a PR that came out last night that will add support for full screen event handling. https://github.com/CommunityToolkit/Maui/pull/2041
I tested against current main repo for MediaElement and toolkit. Could not reproduce issue. Will keep this open till #2041 is merged.
Can you try the latest version? 4.1.0 Came out last week.
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
The Android app crashes when the fullscreen button is clicked.
Expected Behavior
The app should not crash when the fullscreen button is clicked.
Steps To Reproduce
Use MediaElement version 3.1.0. Click the fullscreen button mainly on a Galaxy S23 Ultra, Galaxy S22 Ultra, or Pixel 8 Pro.
Link to public reproduction project repository
https://github.com/vikher/testmedia
Environment
Anything else?
Error Details:
Error: System.ObjectDisposedException Message: ObjectDisposed_Generic ObjectDisposed_ObjectName_Name, CommunityToolkit.Maui.Core.Views.MauiMediaElement
Code Context:
I'm using DisconnectMediaElementHandler method to dispose the media element, based on this discussion:
The DisconnectMediaElementHandler method is executed when the page disappears, not when the fullscreen button is clicked, at least on Android.
I'm not using ContentPage_Unloaded because, on iOS, when the fullscreen button is clicked and it enters fullscreen mode, CnkContentPage_Unloaded gets called and disposes of the media element view.
Additional Information: There is no current way to trigger a specialized event in Maui when the fullscreen button is clicked.
The following screenshot from the app center![image](https://github.com/user-attachments/assets/83705a21-6a05-4580-8a4c-1420b2d52ce4)