julianCast edited a comment on issue #201:
URL:
https://github.com/apache/cordova-plugin-media/issues/201#issuecomment-713014522
> on success fires when playback finishes on iOS.
> on android it also fires if the media is stopped at any point.
So, using android, what is the way to detect when the track has naturally
ended?
I was using onSuccess but clearly that's not the way.
Thank you!
This is my workaround:
```
this.music.onSuccess.subscribe(() => {
console.info('Track has changed')
this.music.getCurrentPosition().then(
(seconds) => {
if (seconds != -1) {
console.info('Track has ended')
this.onCurrentSongFinished()
}
}
)
});
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]