XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

[Bug] [Android] MediaElement works unstable inside CarouselView / SfRotator

Open RadoslawKubas opened this issue 4 years ago • 6 comments

Description

If page contains MediaElement inside CarouselView / SfRotator strange things happen on Android (on iOS everything works perfect).

  1. When CarouselView is scrolled (or just created for the first time) it is possible to see exception:
01-05 13:54:34.778 W/MediaPlayer(19222): Couldn't open https://sec.ch9.ms/...
01-05 13:54:34.778 W/MediaPlayer(19222): java.io.FileNotFoundException: No content provider: https://sec.ch9.ms/ch9/5d93/a1eab4bf-3288-4faf-81c4-294402a85d93/XamarinShow_mid.mp4
01-05 13:54:34.778 W/MediaPlayer(19222): 	at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1686)  

  1. If page contains standalone MediaElement and CarouselView with MediaElements inside, scrolling CarouselView sometimes rewinds the video backwards a few seconds on standalone MediaElement.

  2. After scrolling CarouselView (or SfRotator) or just after new CarouselView is created sometimes MediaElements not displaying any video, just transparent frame (it happens only on certain Android devices).

It seems that opened MediaElements interfere with each other. It happened also just with one CarouselView or SfRotator without any standalone MediaElement, just then it is less visible and seems to happen not on every Android device (or not always).

Steps to Reproduce

  1. On Android create page with standalone MediaElement and CarouselView with MediaElement items inside.
  2. Scroll left or right few times

Expected Behavior

Group of MediaElements works on Android same way as on iOS, without any problem.

Actual Behavior

On Android, MediaElements interfere with each other.

Basic Information

  • Version with issue: 1.0.0-pre6
  • Platform Target Frameworks:
    • Android: 11

Reproduction Link

MediaElementProblem04.zip

RadoslawKubas avatar Jan 05 '21 13:01 RadoslawKubas

Same problem still exists in 1.0.0 version.

RadoslawKubas avatar Jan 08 '21 12:01 RadoslawKubas

Thanks for letting us know! We'll do our best to look into it. To be honest I'm not sure if using a MediaElement in controls like these is the best idea to begin with, so you might want to look into other ways of doing the thing you want to achieve. But we'll see what we can do.

Thanks!

jfversluis avatar Jan 08 '21 12:01 jfversluis

@jfversluis Thank you! Yeah, I'm considering using different approach (at least on Android, on iOS it works really nice), but before, I was using XamarinMediaManager and it was working fairly nice on Android also, so I believe it is possible.

RadoslawKubas avatar Jan 08 '21 13:01 RadoslawKubas

Does anyone have a good solution / substitute to help the community? I am investigating and will try to share if I have any headway.

Painwraith avatar Sep 16 '21 17:09 Painwraith

I am having this issue.... Any solution?

mcferdev avatar Oct 18 '22 13:10 mcferdev

Hello, carouselView seems to be the best alternative to develop an application similar to TikTok and Instagram. Apart from that, is there anyone who can work MediaElement and scrolling video feature with a different component?

zafrkaya avatar Oct 16 '23 14:10 zafrkaya