From 5bd6cc7c4471d4971ee9e840ce8e73c64d7bda4d Mon Sep 17 00:00:00 2001 From: "Thomas W." Date: Thu, 5 Sep 2024 11:01:50 +0200 Subject: [PATCH] fix: retain exoplayer on orientation change (#6428) --- .../github/libretube/ui/fragments/PlayerFragment.kt | 11 ----------- 1 file changed, 11 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 ff9c9145e..ca185ec88 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 @@ -845,12 +845,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { viewModel.player.removeListener(playerListener) viewModel.player.pause() - runCatching { - if (!viewModel.isOrientationChangeInProgress) { - viewModel.player.stop() - } - } - if (PlayerHelper.pipEnabled) { // disable the auto PiP mode for SDK >= 32 PictureInPictureCompat @@ -1347,11 +1341,6 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { } private fun createExoPlayer() { -// viewModel.keepOrCreatePlayer(requireContext()).let { (player, trackSelector) -> -// localViewModel.player = player -// localViewModel.trackSelector = trackSelector -// } - viewModel.player.setWakeMode(C.WAKE_MODE_NETWORK) viewModel.player.addListener(playerListener)