mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-15 06:40:30 +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 {
|
binding.close.setOnClickListener {
|
||||||
|
activity?.unbindService(connection)
|
||||||
BackgroundHelper.stopBackgroundPlay(requireContext())
|
BackgroundHelper.stopBackgroundPlay(requireContext())
|
||||||
findNavController().popBackStack()
|
findNavController().popBackStack()
|
||||||
}
|
}
|
||||||
@ -242,7 +243,9 @@ class AudioPlayerFragment : Fragment(), AudioPlayerOptions {
|
|||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
// unregister all listeners and the connected [playerService]
|
// unregister all listeners and the connected [playerService]
|
||||||
playerService?.onIsPlayingChanged = null
|
playerService?.onIsPlayingChanged = null
|
||||||
activity?.unbindService(connection)
|
runCatching {
|
||||||
|
activity?.unbindService(connection)
|
||||||
|
}
|
||||||
PlayingQueue.removeOnTrackChangedListener(onTrackChangeListener)
|
PlayingQueue.removeOnTrackChangedListener(onTrackChangeListener)
|
||||||
|
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
|
Loading…
Reference in New Issue
Block a user