You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2017/02/25 02:02:00 UTC
cordova-plugin-media git commit: fix(android):
java.lang.NullPointerException on resumeAllGainedFocus
Repository: cordova-plugin-media
Updated Branches:
refs/heads/master cc4d641b9 -> 88a69305e
fix(android): java.lang.NullPointerException on resumeAllGainedFocus
This closes #122
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/commit/88a69305
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/88a69305
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/88a69305
Branch: refs/heads/master
Commit: 88a69305eb7f2e7c03481f951a1d349f2a8b4ad0
Parents: cc4d641
Author: Frank Koenigstein <fr...@dff-solutions.de>
Authored: Thu Nov 17 09:26:31 2016 +0100
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Feb 24 16:44:01 2017 -0800
----------------------------------------------------------------------
.gitignore | 7 +++++--
src/android/AudioHandler.java | 2 +-
src/android/AudioPlayer.java | 9 ++++++++-
3 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/88a69305/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 6964ea0..ed83a7a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,10 +14,13 @@ Thumbs.db
node_modules
+#eclipse
+bin
+.project
+.classpath
-
-
\ No newline at end of file
+
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/88a69305/src/android/AudioHandler.java
----------------------------------------------------------------------
diff --git a/src/android/AudioHandler.java b/src/android/AudioHandler.java
index 48211ad..9e734c4 100644
--- a/src/android/AudioHandler.java
+++ b/src/android/AudioHandler.java
@@ -411,7 +411,7 @@ public class AudioHandler extends CordovaPlugin {
public void resumeAllGainedFocus() {
for (AudioPlayer audio : this.pausedForFocus) {
- audio.startPlaying(null);
+ audio.resumePlaying();
}
this.pausedForFocus.clear();
}
http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/88a69305/src/android/AudioPlayer.java
----------------------------------------------------------------------
diff --git a/src/android/AudioPlayer.java b/src/android/AudioPlayer.java
index d46f4b4..97d63fc 100644
--- a/src/android/AudioPlayer.java
+++ b/src/android/AudioPlayer.java
@@ -357,6 +357,13 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
}
/**
+ * Resume playing.
+ */
+ public void resumePlaying() {
+ this.startPlaying(this.audioFile);
+ }
+
+ /**
* Callback to be invoked when playback of a media source has completed.
*
* @param player The MediaPlayer that reached the end of the file
@@ -585,7 +592,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
//if we are readying the same file
if (this.audioFile.compareTo(file) == 0) {
//maybe it was recording?
- if(this.recorder!=null && player==null) {
+ if (player == null) {
this.player = new MediaPlayer();
this.player.setOnErrorListener(this);
this.prepareOnly = false;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org