incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From macdo...@apache.org
Subject [2/2] android commit: CB-1358: Getting Force Close in incoming Cal while recording the Audio?
Date Fri, 31 Aug 2012 16:50:45 GMT
CB-1358: Getting Force Close in incoming Cal while recording the Audio?


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/4d5e452e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/tree/4d5e452e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/diff/4d5e452e

Branch: refs/heads/master
Commit: 4d5e452ecedcc7b0ab756ce3ffd2c2aeaead71e7
Parents: 1ba3ecb
Author: Simon MacDonald <simon.macdonald@gmail.com>
Authored: Fri Aug 31 12:45:01 2012 -0400
Committer: Simon MacDonald <simon.macdonald@gmail.com>
Committed: Fri Aug 31 12:45:01 2012 -0400

----------------------------------------------------------------------
 framework/src/org/apache/cordova/AudioPlayer.java |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-android/blob/4d5e452e/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 90e0e16..3716012 100644
--- a/framework/src/org/apache/cordova/AudioPlayer.java
+++ b/framework/src/org/apache/cordova/AudioPlayer.java
@@ -207,7 +207,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener,
On
      * @param file              The name of the audio file.
      */
     public void startPlaying(String file) {
-        if (this.readyPlayer(file)) {
+        if (this.readyPlayer(file) && this.player != null) {
             this.player.start();
             this.setState(STATE.MEDIA_RUNNING);
             this.seekOnPrepared = 0; //insures this is always reset
@@ -236,7 +236,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener,
On
     public void pausePlaying() {
 
         // If playing, then pause
-        if (this.state == STATE.MEDIA_RUNNING) {
+        if (this.state == STATE.MEDIA_RUNNING && this.player != null) {
             this.player.pause();
             this.setState(STATE.MEDIA_PAUSED);
         }


Mime
View raw message