mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
CB-1196: No onSuccess callback after a complete play of the local mp3 file
This commit is contained in:
parent
fdcf9c5327
commit
6cb8d11b22
@ -49,11 +49,11 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
|
|
||||||
// AudioPlayer states
|
// AudioPlayer states
|
||||||
public enum STATE { MEDIA_NONE,
|
public enum STATE { MEDIA_NONE,
|
||||||
MEDIA_LOADING,
|
|
||||||
MEDIA_STARTING,
|
MEDIA_STARTING,
|
||||||
MEDIA_RUNNING,
|
MEDIA_RUNNING,
|
||||||
MEDIA_PAUSED,
|
MEDIA_PAUSED,
|
||||||
MEDIA_STOPPED
|
MEDIA_STOPPED,
|
||||||
|
MEDIA_LOADING
|
||||||
};
|
};
|
||||||
|
|
||||||
private static final String LOG_TAG = "AudioPlayer";
|
private static final String LOG_TAG = "AudioPlayer";
|
||||||
@ -397,7 +397,7 @@ public class AudioPlayer implements OnCompletionListener, OnPreparedListener, On
|
|||||||
*/
|
*/
|
||||||
private void setState(STATE state) {
|
private void setState(STATE state) {
|
||||||
if (this.state != state) {
|
if (this.state != state) {
|
||||||
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', " + MEDIA_STATE + ", " + this.state.ordinal() + ");");
|
this.handler.sendJavascript("cordova.require('cordova/plugin/Media').onStatus('" + this.id + "', " + MEDIA_STATE + ", " + state.ordinal() + ");");
|
||||||
}
|
}
|
||||||
this.state = state;
|
this.state = state;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user