Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,9 @@ class PreviewImageActivity :
val showBars = !isActionBarVisible
toggleActionBarVisibility(showBars)
if (showBars) {
windowInsetsController.show(WindowInsetsCompat.Type.navigationBars())
windowInsetsController.show(WindowInsetsCompat.Type.systemBars())
} else {
windowInsetsController.hide(WindowInsetsCompat.Type.navigationBars())
windowInsetsController.hide(WindowInsetsCompat.Type.systemBars())
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import com.nextcloud.client.player.model.PlayerThumbnailLoader
import com.nextcloud.client.player.model.file.PlaybackCollection
import com.nextcloud.client.player.model.file.PlaybackFile
import com.nextcloud.client.player.model.state.PlaybackState
import com.nextcloud.client.player.model.state.PlayerState
import com.nextcloud.client.player.model.state.VideoSize
import com.nextcloud.client.player.ui.MediaNavigator
import com.nextcloud.client.player.util.PlayerUtil.applyVideoSize
Expand Down Expand Up @@ -370,6 +371,11 @@ class PreviewPlaybackFragment :
if (isCurrentItem(state)) {
wasCurrentItem = true
showVideo(state?.currentItemState?.videoSize)

// Keep the screen on while playing. This works because it's called at every playback update and when
// the surfaceview is not visible (scrolled away, app in background...)
binding.surfaceView.keepScreenOn = state?.currentItemState?.playerState == PlayerState.PLAYING

return
}

Expand Down
Loading