MediaPlayer states are protected by mutexes in the native layer.
However, the playback complete is an asynchronous event that comes on
a binder worker thread. It's possible that you could call reset() in
the window after the native media player service has posted a playback
complete message to
I am one, and the error you posted indicates you called setDataSource
while the MediaPlayer was in the 'playback completed' state.
It could be a race condition in the framework, but since I have never
seen this problem occur with the Android music app, I'm inclined to
think it's a problem with
I agree that it's most likely me doing something wrong.
It looks like when the audio file is about to end the state of
MediaPlayer gets changed in the native code.
And maybe reset() doesn't take effect during this process while
setDataSource(), invoked right after, finds player not to be ready.
Looks like you're calling MediaPlayer.setDataSource() on a MediaPlayer
that was already initialized, without first calling
MediaPlayer.reset()
On Tue, Apr 7, 2009 at 1:28 PM, ATrubka atru...@gmail.com wrote:
Hi, guys.
I'm using MediaPlayer and sometimes when first audio is about to end
MediaPlayer.reset() always gets invoked. Here's the exact lines of
code:
_mediaPlayer.reset();
_mediaPlayer.setDataSource(resource);
_mediaPlayer.prepare();
_mediaPlayer.start();
Additionally, the error occurs only when next audio
5 matches
Mail list logo