fixed #861
This commit is contained in:
parent
4ef27bfd58
commit
9f4d4fed13
|
@ -117,11 +117,13 @@ class ExoPlayerPageFragment : MediaViewerFragment(), IBaseFragment<ExoPlayerPage
|
||||||
override fun onPlayerStateChanged(playWhenReady: Boolean, playbackState: Int) {
|
override fun onPlayerStateChanged(playWhenReady: Boolean, playbackState: Int) {
|
||||||
when (playbackState) {
|
when (playbackState) {
|
||||||
ExoPlayer.STATE_BUFFERING -> {
|
ExoPlayer.STATE_BUFFERING -> {
|
||||||
|
playerView.keepScreenOn = true
|
||||||
showProgress(true, 0f)
|
showProgress(true, 0f)
|
||||||
}
|
}
|
||||||
ExoPlayer.STATE_ENDED -> {
|
ExoPlayer.STATE_ENDED -> {
|
||||||
playbackCompleted = true
|
playbackCompleted = true
|
||||||
positionBackup = -1L
|
positionBackup = -1L
|
||||||
|
playerView.keepScreenOn = false
|
||||||
|
|
||||||
// Reset position
|
// Reset position
|
||||||
playerView.player?.let { player ->
|
playerView.player?.let { player ->
|
||||||
|
@ -136,9 +138,11 @@ class ExoPlayerPageFragment : MediaViewerFragment(), IBaseFragment<ExoPlayerPage
|
||||||
ExoPlayer.STATE_READY -> {
|
ExoPlayer.STATE_READY -> {
|
||||||
playbackCompleted = playWhenReady
|
playbackCompleted = playWhenReady
|
||||||
playerHasError = false
|
playerHasError = false
|
||||||
|
playerView.keepScreenOn = playWhenReady
|
||||||
hideProgress()
|
hideProgress()
|
||||||
}
|
}
|
||||||
ExoPlayer.STATE_IDLE -> {
|
ExoPlayer.STATE_IDLE -> {
|
||||||
|
playerView.keepScreenOn = false
|
||||||
hideProgress()
|
hideProgress()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue