forked from github/cordova-android
CB-1264: Media.stop() puts media into an unplayable state
This commit is contained in:
parent
1d28506b09
commit
8d0e80620a
@ -253,7 +253,9 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
*/
|
*/
|
||||||
public void stopPlaying() {
|
public void stopPlaying() {
|
||||||
if ((this.state == STATE.MEDIA_RUNNING) || (this.state == STATE.MEDIA_PAUSED)) {
|
if ((this.state == STATE.MEDIA_RUNNING) || (this.state == STATE.MEDIA_PAUSED)) {
|
||||||
this.player.stop();
|
this.player.pause();
|
||||||
|
this.player.seekTo(0);
|
||||||
|
Log.d(LOG_TAG, "stopPlaying is calling stopped");
|
||||||
this.setState(STATE.MEDIA_STOPPED);
|
this.setState(STATE.MEDIA_STOPPED);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -268,6 +270,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
* @param player The MediaPlayer that reached the end of the file
|
* @param player The MediaPlayer that reached the end of the file
|
||||||
*/
|
*/
|
||||||
public void onCompletion(MediaPlayer player) {
|
public void onCompletion(MediaPlayer player) {
|
||||||
|
Log.d(LOG_TAG, "on completion is calling stopped");
|
||||||
this.setState(STATE.MEDIA_STOPPED);
|
this.setState(STATE.MEDIA_STOPPED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user