Allow the Player to be detached when unprepared
ouchadam opened this issue · 1 comments
ouchadam commented
Problem
The NoPlayer
can not be detached if it isn't prepared due to subtitles
java.lang.IllegalStateException: Video must be loaded before trying to interact with the player
at com.novoda.noplayer.internal.exoplayer.ExoPlayerFacade.assertVideoLoaded(ExoPlayerFacade.java:197)
at com.novoda.noplayer.internal.exoplayer.ExoPlayerFacade.removeSubtitleRendererOutput(ExoPlayerFacade.java:172)
at com.novoda.noplayer.internal.exoplayer.ExoPlayerTwoImpl.detach(ExoPlayerTwoImpl.java:231)
Potential Solution
Ignoring the removal of subtitles if the internal player is missing.
Impact
- The
NoPlayer
will be detachable without being prepared.
ouchadam commented
Seems this has been fixed with the introduction of the textOutput
guard.
The original bug can only happen if a subtitle track was selected before the player prepared, which shouldn't be possible