From 8d0e80620a1f62c64784606612bb83034f14e424 Mon Sep 17 00:00:00 2001 From: macdonst Date: Mon, 20 Aug 2012 12:06:39 -0400 Subject: [PATCH] CB-1264: Media.stop() puts media into an unplayable state --- framework/src/org/apache/cordova/AudioPlayer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/src/org/apache/cordova/AudioPlayer.java b/framework/src/org/apache/cordova/AudioPlayer.java index 3c3c9626..6fbb8cca 100644 --- a/framework/src/org/apache/cordova/AudioPlayer.java +++ b/framework/src/org/apache/cordova/AudioPlayer.java @@ -253,7 +253,9 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On */ public void stopPlaying() { if ((this.state == STATE.MEDIA_RUNNING) || (this.state == STATE.MEDIA_PAUSED)) { - this.player.stop(); + this.player.pause(); + this.player.seekTo(0); + Log.d(LOG_TAG, "stopPlaying is calling stopped"); this.setState(STATE.MEDIA_STOPPED); } else { @@ -268,6 +270,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On * @param player The MediaPlayer that reached the end of the file */ public void onCompletion(MediaPlayer player) { + Log.d(LOG_TAG, "on completion is calling stopped"); this.setState(STATE.MEDIA_STOPPED); }