remember the playback speed per session

This commit is contained in:
Bnyro 2022-12-08 18:21:56 +01:00
parent 834d0823f1
commit 92c60302e8

View File

@ -76,6 +76,9 @@ internal class CustomExoPlayerView(
if (isControllerFullyVisible) hideController() else showController()
}
// saved to only load the playback speed once (for the first video)
private var playbackPrefSet = false
fun initialize(
playerViewInterface: OnlinePlayerOptions?,
doubleTapOverlayBinding: DoubleTapOverlayBinding,
@ -98,10 +101,13 @@ internal class CustomExoPlayerView(
initializeAdvancedOptions(context)
if (!playbackPrefSet) {
player?.playbackParameters = PlaybackParameters(
PlayerHelper.playbackSpeed.toFloat(),
1.0f
)
playbackPrefSet = true
}
// locking the player
binding.lockPlayer.setOnClickListener {