Bug 23171 - MediaPlayer.CurrentPosition Keeps Progressing After a Play/Pause Cycle
Summary: MediaPlayer.CurrentPosition Keeps Progressing After a Play/Pause Cycle
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.18.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: dean.ellis
Depends on:
Reported: 2014-09-18 21:52 UTC by Cody Beyer (MSFT)
Modified: 2014-10-12 14:15 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Cody Beyer (MSFT) 2014-09-18 21:52:32 UTC
When Play and Pause are called in a quick succession on Android's MediaPlayer, the CurrentPosition is updated like the song is playing.

Sample project (make sure to set it to a correct song in Game1.cs:44):


Xamarin (6b70b1e28c5a733187f7659220da4c0ff61ab2b1)

Visual Studio extension to enable development for Xamarin.iOS and
Comment 3 dean.ellis 2014-09-26 06:35:10 UTC
It looks like there are a host of issues with the underlying android media player see


So I knocked up a sample in Java and managed to get it to exhibit the same behaviour, but only on short .wav files. longer .mp3 songs seemed to work ok. So this looks like an upstream issue. 

That said it does look like the media player is correctly reporting when it is paused. So this probably needs to be worked around within the MonoGame framework. Something like this might do the trick


It seems to work here locally. If you can confirm then I'll submit a PR to the MonoGame guys to see if we can get this fixed.
Comment 4 Adam Kapos 2014-10-02 18:01:06 UTC
Hello Dean!
I hope you received my message from the support team. Did you have a chance to submit this to MonoGame yet?
Comment 5 dean.ellis 2014-10-03 04:03:29 UTC
Hi Adam

I was waiting to hear if the work around I posted worked for you too? If it does then I'll submit a PR this weekend
Comment 6 Adam Kapos 2014-10-03 04:27:04 UTC
Yes, it worked :)
Comment 7 dean.ellis 2014-10-03 04:31:24 UTC
Awesome, I'll put this PR up over the weekend
Comment 8 Adam Kapos 2014-10-11 08:22:14 UTC
Did you submit the PR?
Comment 9 Adam Kapos 2014-10-12 14:15:51 UTC
I have submitted it: