Updated Branches: refs/heads/master 1d28506b0 -> 8d0e80620
CB-1264: Media.stop() puts media into an unplayable state Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/commit/8d0e8062 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/8d0e8062 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/8d0e8062 Branch: refs/heads/master Commit: 8d0e80620a1f62c64784606612bb83034f14e424 Parents: 1d28506 Author: macdonst <[email protected]> Authored: Mon Aug 20 12:06:39 2012 -0400 Committer: macdonst <[email protected]> Committed: Mon Aug 20 12:06:39 2012 -0400 ---------------------------------------------------------------------- framework/src/org/apache/cordova/AudioPlayer.java | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/8d0e8062/framework/src/org/apache/cordova/AudioPlayer.java ---------------------------------------------------------------------- diff --git a/framework/src/org/apache/cordova/AudioPlayer.java b/framework/src/org/apache/cordova/AudioPlayer.java index 3c3c962..6fbb8cc 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); }
