Skip to content

Commit d3f806a

Browse files
authored
Try to fix Exoplayer illegal state (#556)
1 parent 47aea9a commit d3f806a

File tree

1 file changed

+8
-0
lines changed
  • readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio

1 file changed

+8
-0
lines changed

readium/adapters/exoplayer/audio/src/main/java/org/readium/adapter/exoplayer/audio/ExoPlayerEngine.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,14 @@ public class ExoPlayerEngine private constructor(
210210
private val sessionPlayer = object :
211211
ForwardingPlayer(exoPlayer) {
212212

213+
override fun getAvailableCommands(): Player.Commands {
214+
val commands = super.getAvailableCommands()
215+
return Player.Commands.Builder()
216+
.addAll(commands)
217+
.remove(COMMAND_STOP) // STOP would unprepare the player.
218+
.build()
219+
}
220+
213221
override fun release() {
214222
// This object does not own the ExoAudiobookPlayer instance, do not close it.
215223
}

0 commit comments

Comments
 (0)