From fece82e8c37b2a100d218f2ba2dec8dc286288d9 Mon Sep 17 00:00:00 2001 From: FineFindus Date: Sun, 18 Feb 2024 13:15:20 +0100 Subject: [PATCH] fix: set music playback speed only once Fixes https://github.com/libre-tube/LibreTube/issues/5626. The playback speed for music videos was set to 1.0x on every event, instead of only once when starting the video. --- .../com/github/libretube/ui/fragments/PlayerFragment.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt index 723136f30..7a2d24a28 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/PlayerFragment.kt @@ -312,9 +312,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { saveWatchPosition() if (playbackState == Player.STATE_READY) { - if (streams.category == Streams.categoryMusic) { - exoPlayer.setPlaybackSpeed(1f) - } } // set the playback speed to one if having reached the end of a livestream @@ -988,6 +985,10 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { } setCurrentChapterName() + + if (streams.category == Streams.categoryMusic) { + exoPlayer.setPlaybackSpeed(1f) + } } } }