Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MediaElement throw ObjectDisposedException when wrapped in CollectionView #2359

Closed
2 tasks done
WolfgangPhy opened this issue Nov 25, 2024 · 4 comments
Closed
2 tasks done
Labels
bug Something isn't working 📽️ MediaElement Issue/PR that has to do with MediaElement needs reproduction stale The author has not responded in over 30 days unverified

Comments

@WolfgangPhy
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The MAUIELEMENT.Handler?.DisconnectHandler() throws an ObjectDisposedException when the MediaElement is wrapped in a ContentView inside a CollectionView.

This issue occurs only when the MediaElement is wrapped in a ContentView (e.g., the VideoPlayer in the reproduction repository). If the MediaElement itself is used as the ItemTemplate, the DisconnectHandler() works as expected.

Expected Behavior

The DisconnectHandler() not throw an exception.

Steps To Reproduce

  1. Open the app in the reproduction project
  2. Click on the CollectionView button
  3. Click on the go back arrow in the NavigationBar

Link to public reproduction project repository

https://github.com/WolfgangPhy/MediaElementInCollectionViewBug.git

Environment

- .NET MAUI CommunityToolkit: 9.1.1
- OS: Android (not tested on iOS yet)
- .NET MAUI: 8

Anything else?

I investigated the issue as thoroughly as I could to identify the root cause. By debugging the MediaElement source code, I found that the exception originates here: [SOURCE] (

).

(My issue might be related to the ExoPlayer issue mentioned in the comments a few lines above.)

You can see a screenshot of the exception here: Source of the exception

Given that the error only occurs when the MediaElement is wrapped, I strongly suspect that CollectionView recycling is the cause of this issue.

@WolfgangPhy WolfgangPhy added bug Something isn't working unverified labels Nov 25, 2024
@vhugogarcia vhugogarcia added the 📽️ MediaElement Issue/PR that has to do with MediaElement label Jan 9, 2025
Copy link
Contributor

Hi @WolfgangPhy! We have added the needs reproduction label to this issue, which indicates that we are unable to take further action until you provide a reproduction sample that we can use to reproduce + fix your bug. In accordance with the Reporting a bug section of our Contributing.md that you confirmed reading before you submitted this Issue, we ask that every Issue author provide a link to an open-source repository containing the reproduction sample app. This issue will be closed automatically in 5 days if we do not receive a reproduction sample from you. Please feel free to re-open this Issue once you have provided a reproduction sample.

@ne0rrmatrix
Copy link
Contributor

The reproduction sample is not public or has been deleted. Please update the sample. Can you try latest version of media element and look at the changes for it?

Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 3 days. It will be closed if no further activity occurs within 2 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.

@dotnet-policy-service dotnet-policy-service bot added the stale The author has not responded in over 30 days label Jan 27, 2025
Copy link
Contributor

We haven't received a reproduction sample from you. The issue is closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working 📽️ MediaElement Issue/PR that has to do with MediaElement needs reproduction stale The author has not responded in over 30 days unverified
Projects
None yet
Development

No branches or pull requests

3 participants