mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 06:10:31 +05:30
Fix closing the audio player
This commit is contained in:
parent
6e3b349e79
commit
02d16ca7f5
@ -140,6 +140,7 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
||||
}
|
||||
|
||||
binding.close.setOnClickListener {
|
||||
activity?.unbindService(connection)
|
||||
BackgroundHelper.stopBackgroundPlay(requireContext())
|
||||
findNavController().popBackStack()
|
||||
}
|
||||
@ -242,7 +243,9 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
||||
override fun onDestroy() {
|
||||
// unregister all listeners and the connected [playerService]
|
||||
playerService?.onIsPlayingChanged = null
|
||||
activity?.unbindService(connection)
|
||||
runCatching {
|
||||
activity?.unbindService(connection)
|
||||
}
|
||||
PlayingQueue.removeOnTrackChangedListener(onTrackChangeListener)
|
||||
|
||||
super.onDestroy()
|
||||
|
Loading…
Reference in New Issue
Block a user