mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +05:30
Merge pull request #3343 from Bnyro/master
Fix crashes on audio player transitions
This commit is contained in:
commit
7d0c48cc75
@ -17,7 +17,6 @@ import androidx.constraintlayout.motion.widget.MotionLayout
|
|||||||
import androidx.fragment.app.Fragment
|
import androidx.fragment.app.Fragment
|
||||||
import androidx.fragment.app.activityViewModels
|
import androidx.fragment.app.activityViewModels
|
||||||
import androidx.fragment.app.commit
|
import androidx.fragment.app.commit
|
||||||
import androidx.navigation.fragment.findNavController
|
|
||||||
import com.github.libretube.R
|
import com.github.libretube.R
|
||||||
import com.github.libretube.api.obj.StreamItem
|
import com.github.libretube.api.obj.StreamItem
|
||||||
import com.github.libretube.databinding.FragmentAudioPlayerBinding
|
import com.github.libretube.databinding.FragmentAudioPlayerBinding
|
||||||
@ -123,6 +122,8 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
binding.openVideo.setOnClickListener {
|
binding.openVideo.setOnClickListener {
|
||||||
|
BackgroundHelper.stopBackgroundPlay(requireContext())
|
||||||
|
killFragment()
|
||||||
NavigationHelper.navigateVideo(
|
NavigationHelper.navigateVideo(
|
||||||
context = requireContext(),
|
context = requireContext(),
|
||||||
videoId = PlayingQueue.getCurrent()?.url?.toID(),
|
videoId = PlayingQueue.getCurrent()?.url?.toID(),
|
||||||
@ -130,8 +131,6 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
keepQueue = true,
|
keepQueue = true,
|
||||||
forceVideo = true
|
forceVideo = true
|
||||||
)
|
)
|
||||||
BackgroundHelper.stopBackgroundPlay(requireContext())
|
|
||||||
findNavController().popBackStack()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
binding.share.setOnClickListener {
|
binding.share.setOnClickListener {
|
||||||
|
@ -478,10 +478,8 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
|
|||||||
keepQueue = true,
|
keepQueue = true,
|
||||||
keepVideoPlayerAlive = true
|
keepVideoPlayerAlive = true
|
||||||
)
|
)
|
||||||
handler.postDelayed(500) {
|
killPlayerFragment()
|
||||||
NavigationHelper.startAudioPlayer(requireContext())
|
NavigationHelper.startAudioPlayer(requireContext())
|
||||||
killPlayerFragment()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setFullscreen() {
|
private fun setFullscreen() {
|
||||||
|
Loading…
Reference in New Issue
Block a user