MediaElement is not working for Xamarin Android

Alexander Povetkin 1 Reputation point
2022-07-23T14:21:52.047+00:00

Hi guys,

Have no idea what else to try but MediaElement is not working.

Steps:

  1. Installed VS2022
  2. Created Xamarin Forms project
  3. Run on android simulator - success
  4. Installed Xamarin.CommunityToolkit
  5. Added MediaElement to MainPage
  6. Run on android simulator - failed
  7. Tried to add Device.SetFlags(new string[] { "MediaElement_Experimental" }); - not help
  8. Updated all packages - not help
  9. Tried to change Android version from 10 to 13 - not help

223975-image.png

Please explain what's wrong? If you can share working simple example it would be great.

Need MediaElement works on Windows and Android.

Developer technologies | .NET | Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Borisoprit 371 Reputation points
    2022-07-23T18:46:07.707+00:00

    Try to set a Width and Height

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.