GitHub user uareurapid opened a pull request:

    https://github.com/apache/cordova-plugin-media/pull/56

    fix record and play NullPointerException

    I´ve came across a use case where i always get a NullPointerException:
    
    1 - Start recording audio file
    2 - Stop recording
    3 - Play the recorded file
    
    When the recording ends, the status is set to "MEDIA_STOPPED", if i try to 
play the recorded file right afterwards, a NullPointerException is thrown at 
line 494 of readyPlayer(...). This happens because the file name is the same as 
the audioFile, and the corresponding switch/case assumes that in this case it 
means that this particular file has already been played before, which is not 
true. At this point there is no "player" object but only a "recorder", 
therefore the exception. With a simple check on the recorder and player it is 
possible to play the newly recorded file without any issues.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uareurapid/cordova-plugin-media master

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cordova-plugin-media/pull/56.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #56
    
----
commit f977aa7c56a7cb50190dfbb393f09e3314b9f509
Author: uareurapid <cristo.pa...@gmail.com>
Date:   2015-05-27T22:21:24Z

    fix record and play NullPointerException

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org
For additional commands, e-mail: dev-h...@cordova.apache.org

Reply via email to