You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ma...@apache.org on 2012/08/31 18:50:45 UTC
[2/2] android commit: CB-1358: Getting Force Close in incoming Cal
while recording the Audio?
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 <si...@gmail.com>
Authored: Fri Aug 31 12:45:01 2012 -0400
Committer: Simon MacDonald <si...@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);
}