From 9f4d4fed133b6d5aa0a84d068dac60b081a5bc9b Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 4 Jun 2017 17:34:26 +0800 Subject: [PATCH] fixed #861 --- .../mariotaku/twidere/fragment/media/ExoPlayerPageFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/media/ExoPlayerPageFragment.kt b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/media/ExoPlayerPageFragment.kt index 9cae1177d..80b27d1e9 100644 --- a/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/media/ExoPlayerPageFragment.kt +++ b/twidere/src/main/kotlin/org/mariotaku/twidere/fragment/media/ExoPlayerPageFragment.kt @@ -117,11 +117,13 @@ class ExoPlayerPageFragment : MediaViewerFragment(), IBaseFragment { + playerView.keepScreenOn = true showProgress(true, 0f) } ExoPlayer.STATE_ENDED -> { playbackCompleted = true positionBackup = -1L + playerView.keepScreenOn = false // Reset position playerView.player?.let { player -> @@ -136,9 +138,11 @@ class ExoPlayerPageFragment : MediaViewerFragment(), IBaseFragment { playbackCompleted = playWhenReady playerHasError = false + playerView.keepScreenOn = playWhenReady hideProgress() } ExoPlayer.STATE_IDLE -> { + playerView.keepScreenOn = false hideProgress() } }