Objective-C Exception when Migrating Xamarin App to MAUI with MediaElement #1769
IniyansHub
started this conversation in
General
Replies: 1 comment
-
There is a PR out that should fix this issue. Can you try building this branch from source and test against your project? #1813 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey everyone,
I'm currently working on migrating a Xamarin App to MAUI. In that, we have a page which renders a live video player where I'm using MediaElement for that purpose. However, whenever I try to navigate to that page, it throws the following error:
ObjCRuntime.ObjCException: Objective-C exception thrown. Name: UIViewControllerHierarchyInconsistency Reason: child view controller:<AVPlayerViewController: 0x7fc27067d200> should have parent view controller:<Microsoft_Maui_Platform_PageViewController: 0x7fc2557d2ca0> but actual parent is:<Microsoft_Maui_Controls_Handlers_Compatibility_NavigationRenderer: 0x7fc2d5bc8a00>
Here's a visual representation of the live visual tree where the error occurs:
Previously in Xamarin, we had been using the CrossMediaManager plugin to render video players.
I've noticed that I encounter this error only when trying to add the MediaElement inside a FloatingVideoPlayer Page, which is of type ContentView. If I try adding it in the BaseEventPage of type ContentView, it doesn't throw any error.
I've tried replicating this scenario in a sample application, but it didn't throw any error. Does anyone have any ideas on how to resolve this issue?
Thanks in advance for your help!
Beta Was this translation helpful? Give feedback.
All reactions