Skip to content

Commit

Permalink
Try to fix Exoplayer illegal state (#556)
Browse files Browse the repository at this point in the history
  • Loading branch information
qnga authored Aug 16, 2024
1 parent 47aea9a commit d3f806a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ public class ExoPlayerEngine private constructor(
private val sessionPlayer = object :
ForwardingPlayer(exoPlayer) {

override fun getAvailableCommands(): Player.Commands {
val commands = super.getAvailableCommands()
return Player.Commands.Builder()
.addAll(commands)
.remove(COMMAND_STOP) // STOP would unprepare the player.
.build()
}

override fun release() {
// This object does not own the ExoAudiobookPlayer instance, do not close it.
}
Expand Down

0 comments on commit d3f806a

Please sign in to comment.