diff --git a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt index 1cb7b97e0..09ab9819c 100644 --- a/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt +++ b/app/src/main/java/com/github/libretube/ui/fragments/AudioPlayerFragment.kt @@ -17,7 +17,6 @@ import androidx.constraintlayout.motion.widget.MotionLayout import androidx.fragment.app.Fragment import androidx.fragment.app.activityViewModels import androidx.fragment.app.commit -import androidx.navigation.fragment.findNavController import com.github.libretube.R import com.github.libretube.api.obj.StreamItem import com.github.libretube.databinding.FragmentAudioPlayerBinding @@ -123,6 +122,8 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions { } binding.openVideo.setOnClickListener { + BackgroundHelper.stopBackgroundPlay(requireContext()) + killFragment() NavigationHelper.navigateVideo( context = requireContext(), videoId = PlayingQueue.getCurrent()?.url?.toID(), @@ -130,8 +131,6 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions { keepQueue = true, forceVideo = true ) - BackgroundHelper.stopBackgroundPlay(requireContext()) - findNavController().popBackStack() } binding.share.setOnClickListener { 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 1b3cdbb50..7245a5629 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 @@ -478,10 +478,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions { keepQueue = true, keepVideoPlayerAlive = true ) - handler.postDelayed(500) { - NavigationHelper.startAudioPlayer(requireContext()) - killPlayerFragment() - } + killPlayerFragment() + NavigationHelper.startAudioPlayer(requireContext()) } private fun setFullscreen() {