You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2015/09/03 22:57:46 UTC

[1/2] cordova-plugin-media git commit: fix record and play NullPointerException

Repository: cordova-plugin-media
Updated Branches:
  refs/heads/master b992df38d -> 6c1a0ec7e


fix record and play NullPointerException


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/f977aa7c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/f977aa7c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/f977aa7c

Branch: refs/heads/master
Commit: f977aa7c56a7cb50190dfbb393f09e3314b9f509
Parents: 7a793cd
Author: uareurapid <cr...@gmail.com>
Authored: Wed May 27 23:21:24 2015 +0100
Committer: uareurapid <cr...@gmail.com>
Committed: Wed May 27 23:21:24 2015 +0100

----------------------------------------------------------------------
 src/android/AudioPlayer.java | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/blob/f977aa7c/src/android/AudioPlayer.java
----------------------------------------------------------------------
diff --git a/src/android/AudioPlayer.java b/src/android/AudioPlayer.java
index 8d983ea..2b9a84f 100644
--- a/src/android/AudioPlayer.java
+++ b/src/android/AudioPlayer.java
@@ -490,10 +490,24 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
                 case MEDIA_STOPPED:
                     //if we are readying the same file
                     if (this.audioFile.compareTo(file) == 0) {
-                        //reset the audio file
-                        player.seekTo(0);
-                        player.pause();
-                        return true;
+                        //maybe it was recording?
+                        if(this.recorder!=null && player==null) {
+                            this.player = new MediaPlayer();
+                            this.prepareOnly = false;
+
+                            try {
+                                this.loadAudioFile(file);
+                            } catch (Exception e) {
+                                sendErrorStatus(MEDIA_ERR_ABORTED);
+                            }
+                            return false;//we´re not ready yet
+                        } 
+                        else {
+                           //reset the audio file
+                            player.seekTo(0);
+                            player.pause();
+                            return true; 
+                        } 
                     } else {
                         //reset the player
                         this.player.reset();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/2] cordova-plugin-media git commit: Merge branch 'master' of https://github.com/uareurapid/cordova-plugin-media

Posted by pu...@apache.org.
Merge branch 'master' of https://github.com/uareurapid/cordova-plugin-media


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/6c1a0ec7
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/tree/6c1a0ec7
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-media/diff/6c1a0ec7

Branch: refs/heads/master
Commit: 6c1a0ec7e7a1fce722b62a2022ef8e563bfb9ceb
Parents: b992df3 f977aa7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Sep 3 13:50:34 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Sep 3 13:50:34 2015 -0700

----------------------------------------------------------------------
 src/android/AudioPlayer.java | 22 ++++++++++++++++++----
 1 file changed, 18 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org