On Sun, Aug 22, 2010 at 7:09 AM, Luca Carlon <carlon.l...@gmail.com> wrote:
> Hi! I don't know if I'm doing something wrong, but I see calling the
> stop function of MediaPlayer simply does nothing. The playback goes
> on. I looked in the documentation and I found:
>
> "Stops playback after playback has been stopped or paused."
>
> So, I tried to pause() it before stopping, but the MediaPlayer then
> pauses and resumes the playback. The only thing I can see is that the
> buffering stops. But the playback continues. Is this the expected
> behavior?

No. Here is a project that behaves correctly:

http://github.com/commonsguy/cw-advandroid/tree/master/Media/Audio/

> Could the problem be related to the fact that I call the
> methods of the MediaPlayer object from different threads than the
> creator by synchronizing with Semaphores?

Possibly -- I don't know whether MediaPlayer uses thread-local values
or anything. I have only ever used MediaPlayer from a single thread.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

_The Busy Coder's Guide to Android Development_ Version 3.1 Available!

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to