mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 14:20:30 +05:30
remember the playback speed per session
This commit is contained in:
parent
834d0823f1
commit
92c60302e8
@ -76,6 +76,9 @@ internal class CustomExoPlayerView(
|
|||||||
if (isControllerFullyVisible) hideController() else showController()
|
if (isControllerFullyVisible) hideController() else showController()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// saved to only load the playback speed once (for the first video)
|
||||||
|
private var playbackPrefSet = false
|
||||||
|
|
||||||
fun initialize(
|
fun initialize(
|
||||||
playerViewInterface: OnlinePlayerOptions?,
|
playerViewInterface: OnlinePlayerOptions?,
|
||||||
doubleTapOverlayBinding: DoubleTapOverlayBinding,
|
doubleTapOverlayBinding: DoubleTapOverlayBinding,
|
||||||
@ -98,10 +101,13 @@ internal class CustomExoPlayerView(
|
|||||||
|
|
||||||
initializeAdvancedOptions(context)
|
initializeAdvancedOptions(context)
|
||||||
|
|
||||||
player?.playbackParameters = PlaybackParameters(
|
if (!playbackPrefSet) {
|
||||||
PlayerHelper.playbackSpeed.toFloat(),
|
player?.playbackParameters = PlaybackParameters(
|
||||||
1.0f
|
PlayerHelper.playbackSpeed.toFloat(),
|
||||||
)
|
1.0f
|
||||||
|
)
|
||||||
|
playbackPrefSet = true
|
||||||
|
}
|
||||||
|
|
||||||
// locking the player
|
// locking the player
|
||||||
binding.lockPlayer.setOnClickListener {
|
binding.lockPlayer.setOnClickListener {
|
||||||
|
Loading…
Reference in New Issue
Block a user