mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 15:12:51 +08:00
CB-1358: Getting Force Close in incoming Cal while recording the Audio?
This commit is contained in:
parent
1ba3ecbef3
commit
4d5e452ece
@ -207,7 +207,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
* @param file The name of the audio file.
|
* @param file The name of the audio file.
|
||||||
*/
|
*/
|
||||||
public void startPlaying(String file) {
|
public void startPlaying(String file) {
|
||||||
if (this.readyPlayer(file)) {
|
if (this.readyPlayer(file) && this.player != null) {
|
||||||
this.player.start();
|
this.player.start();
|
||||||
this.setState(STATE.MEDIA_RUNNING);
|
this.setState(STATE.MEDIA_RUNNING);
|
||||||
this.seekOnPrepared = 0; //insures this is always reset
|
this.seekOnPrepared = 0; //insures this is always reset
|
||||||
@ -236,7 +236,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
public void pausePlaying() {
|
public void pausePlaying() {
|
||||||
|
|
||||||
// If playing, then pause
|
// If playing, then pause
|
||||||
if (this.state == STATE.MEDIA_RUNNING) {
|
if (this.state == STATE.MEDIA_RUNNING && this.player != null) {
|
||||||
this.player.pause();
|
this.player.pause();
|
||||||
this.setState(STATE.MEDIA_PAUSED);
|
this.setState(STATE.MEDIA_PAUSED);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user