Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] MediaElement wont dispose on fresh install? #1991

Open
Pmr-precure opened this issue Oct 18, 2023 · 4 comments
Open

[Bug] MediaElement wont dispose on fresh install? #1991

Pmr-precure opened this issue Oct 18, 2023 · 4 comments
Labels
bug Something isn't working. Breaky break.

Comments

@Pmr-precure
Copy link

Pmr-precure commented Oct 18, 2023

Description

Okay, I have this weird bug that I really hope you guys can help me.

I use a MediaElement to show a video, that MediaElement is inside of a StateView.
When I install the App totally fresh it acts very weird, let me try to show with some screenshots:
I put an eventlistener on the media element to show the state of it.

image
Here after the fresh install i see the mediaelement plays as it should, now i press our button "Skan QR koden":

image
Now i see part of the video showing, in the camera field (sometimes you have to minimize the app and reopen it to make it appear).
I have tried to NULL the source of the mediaelement when switching state, nothing seems to kill the player.

Okay but now I close/rebuild the app and run it again:
image

The mediaelement is playing the video as it should. I now go to the QR page:
image
The media element now stopped as I expected and is not shown partly on the camera view.

I really have no idea whats going on. Please let me know if i didnt explain it well enough.

This is btw only an Android issue it seems.
I tried to create a custom renderer for the mediaelement, and i see in both cases that the Release method gets called, with no errors. But it seems like it only gets released on the 2nd try and not on a fresh install....

We have always struggled with the MediaElement ( we use a lot of tutorial videos) especially using them in a CarouselView ( but we solved those by stopping and/or using Opacity 0 to hide old videos).

I tried upgrading all my nuget packages, but still the same issue.

  • Version with issue:
  • Last known good version:
  • IDE:
  • Platform Target Frameworks:
    • iOS:
    • Android: 12
    • UWP:
  • Android Support Library Version:
  • Nuget Packages: XCT 2.0.4 - Xamarin 5.0.0.2515
  • Affected Devices: Tested on emulators. Huawei P30, different Xiaomi phones.

Workaround

No work around found.

Reproduction imagery

@Pmr-precure Pmr-precure added the bug Something isn't working. Breaky break. label Oct 18, 2023
@Pmr-precure
Copy link
Author

No one? 🤞

@bijington
Copy link
Contributor

Sadly I am not sure I can add much but... do you play the video on the first time the app opens? Basically I am wondering if you can rule out whether it really is a fresh app install issue or somehow an issue with the first time you play the video, perhaps it relates to the video being cached on disk somewhere and the first time it for some reason refuses to stop.

With your trick to use opacity to hide the media element, is that an option here?

@Pmr-precure
Copy link
Author

Sadly I am not sure I can add much but... do you play the video on the first time the app opens? Basically I am wondering if you can rule out whether it really is a fresh app install issue or somehow an issue with the first time you play the video, perhaps it relates to the video being cached on disk somewhere and the first time it for some reason refuses to stop.

With your trick to use opacity to hide the media element, is that an option here?

I tried the opacity trick, but no luck.
If its a caching issue, what could I do?

@bijington
Copy link
Contributor

Sorry I forgot to get back to this. I am not sure what you would do if it was a caching issue. I was mostly just trying to throw in random options to help try and track down the source of the issue, then we can decide where to go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working. Breaky break.
Projects
None yet
Development

No branches or pull requests

2 participants