XamarinCommunityToolkit
XamarinCommunityToolkit copied to clipboard
[Bug] Custom Position slider value is not updating in Media Element on android
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
- 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)
Thanks for the report! Did you by any chance also test it on iOS? Does it work there?
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
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
Hello, problem is not solved?
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.
I've created a repository showcasing some of the MediaElement bugs, including this one: https://github.com/ewerspej/MediaCustomTransport