Xamarincommunitytoolkit: [Bug][Android] MediaElement custom position bar doesn't work

Created on 13 Feb 2020  路  4Comments  路  Source: xamarin/XamarinCommunityToolkit

Description

On the MediaElement control on Android, my custom position bar doesn't work. However, it does work on iOS.

This is all because setting MediaElement.Position on Android doesn't actually update the Position value. I confirmed this with the following code:

// Set position to 1 min
mediaElement.Position = new TimeSpan(0,1,0);

The Position property doesn't change after running this code on Android.

Steps to Reproduce

  1. Run the attached sample.
  2. Browse to the last page in the list (Custom Position Bar).
  3. Play the video.
  4. Drag the slider to later in the video.

Expected Behavior

Slider is draggable and the video plays from the new seek point.

Actual Behavior

Slider is draggable but the video keeps on playing from the beginning.

Basic Information

  • Version with issue: 4.5-pre4
  • IDE: VS Mac 8.4.5
  • Platform Target Frameworks:

    • Android: API 28

Reproduction Link

WorkingWithMediaElement.zip

MediaElement bug android unverified

Most helpful comment

It looks like we don't call SeekTo on Android when the position is set.

Ran into this in Hanselman.Forms

All 4 comments

It looks like we don't call SeekTo on Android when the position is set.

Ran into this in Hanselman.Forms

Is there any workaround available?

Tried implementing via: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/mediaelement#implement-a-custom-position-bar

Seems the custom position bar code example provided isn't working on Android, suspect this is the core issue.

I think this might be fixed by #381

Was this page helpful?
0 / 5 - 0 ratings