4
0
mirror of https://github.com/apache/cordova-android.git synced 2025-03-29 02:12:50 +08:00

Fix for Issue : Media.release() accidentally makes a call to the Media error callback

This commit is contained in:
macdonst 2011-08-26 00:14:50 +08:00 committed by brianleroux
parent 4a38f160fb
commit 9083e921d9

@ -86,7 +86,10 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
// Stop any play or record
if (this.mPlayer != null) {
this.stopPlaying();
if ((this.state == MEDIA_RUNNING) || (this.state == MEDIA_PAUSED)) {
this.mPlayer.stop();
this.setState(MEDIA_STOPPED);
}
this.mPlayer.release();
this.mPlayer = null;
}