Skip to content

Is there a EndPlayback callbeck for player? #757

Answered by pschatzmann
0x0fe asked this question in Q&A
Discussion options

You must be logged in to vote

There are many ways to solve this. The most obvious ones are:

  • check the result from the copy() call. You will get 0 immediately if there is no more data.
  • you can query the player if it is still active: e.g with if(player.isActive()) or just if(player). This is set to false after the timeout.
  • you can create a subclass of AudioPlayer and overwrite the moveToNextFileOnTimeout() method to implement your own callback
  • you can add your own callback method to the AudioPlayer class and share your work with a pull request
  • leave the player in autonext mode and handle the logic in your nextStream() method of your custom audio source.

Replies: 4 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@0x0fe
Comment options

Answer selected by pschatzmann
Comment options

You must be logged in to vote
1 reply
@0x0fe
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@0x0fe
Comment options

@pschatzmann
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants