XamarinCommunityToolkit icon indicating copy to clipboard operation
XamarinCommunityToolkit copied to clipboard

[Bug] Custom Position slider value is not updating in Media Element on android

Open AswinPG opened this issue 3 years ago • 6 comments

Description

Binding Position to a slider does not update the slider position on android as video position changes. The community toolkit sample app has this issue.

Steps to Reproduce

  1. Simply open the community toolkit sample app for android and go to mediaelement page

Expected Behavior

Position changes are reflected on the slider

Actual Behavior

Position changes are not reflected

Basic Information

  • Version with issue: 1.1
  • Last known good version: doesn't know
  • IDE: VS2019
  • Platform Target Frameworks:
    • Android: 10

Workaround

None found I tried with setting the Maximum to 1 and created a converter to provide position value between 0 and 1. It worked fine but when I used the Position property to seek forward, it resulted in an error. The mediaplayer kept on Updating position repeatedly

Reproduction Link

XCT Sample app (android)

AswinPG avatar Jul 01 '21 21:07 AswinPG

Thanks for the report! Did you by any chance also test it on iOS? Does it work there?

jfversluis avatar Jul 05 '21 15:07 jfversluis

Thanks for the report! Did you by any chance also test it on iOS? Does it work there?

Yes I did. It's working on iOS finely. No issues

AswinPG avatar Jul 05 '21 16:07 AswinPG

But I did notice that there is an issue of repeated Seek if we increase the speed above 1.5x. And that happens only if we bind the Position to the Slider

AswinPG avatar Jul 05 '21 16:07 AswinPG

Hello, problem is not solved?

scriptBoris avatar Oct 27 '21 23:10 scriptBoris

But I did notice that there is an issue of repeated Seek if we increase the speed above 1.5x. And that happens only if we bind the Position to the Slider

This happens because the video sets the position on the controller, which could be to update the display (as you want), but could also be to seek to a new position. To avoid playback hiccups when it's just supposed to update the display, there's a timer that goes off every 200ms to set the controller's position, and the controller has logic that doesn't do a seek if the new position is within 300ms of the old position (since it's probably just an update, and not an attempt to seek). When the playback speed is 1.5x, after 200ms, the offset is 300ms, so it actually does a seek.

ubik2 avatar Jun 02 '22 06:06 ubik2

I've created a repository showcasing some of the MediaElement bugs, including this one: https://github.com/ewerspej/MediaCustomTransport

ewerspej avatar Mar 31 '23 17:03 ewerspej