Closed milayihe closed 8 years ago
If you read the README carefully, you can see:
mRxAudioPlayer.play(PlayConfig.file(audioFile).looping(true).build())
.subscribeOn(Schedulers.io())
.subscribe(new Action1<Boolean>() {
@Override
public void call(Boolean aBoolean) {
// play finished
// NOTE: if looping, the Single will never finish, you need stop playing
// onDestroy, otherwise, memory leak will happen!
}
});
@Piasy but I found .subscribe() just monitor the start, And .doOnCompleted() monitor the finish status.That's right????
How do you find it out? When the play is finished, the returned Single
will get a onSuccess
event.
I tracked your code, found .doOnCompleted() method useful for me .
The RxAudioPlayer.play
will return a Single
object, it will emit an onSuccess
event when the playing is finished.
How do you use the returned Single
object is totally free to you :)
Tks a lot
How to get the play finish status?