mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 22:00:30 +05:30
fix: crash when starting next video before current started
This commit is contained in:
parent
fabcdc02a6
commit
c881b6ff5c
@ -70,11 +70,16 @@ object NavigationHelper {
|
||||
|
||||
val activity = ContextHelper.unwrapActivity<MainActivity>(context)
|
||||
val attachedToRunningPlayer = activity.runOnPlayerFragment {
|
||||
this.playNextVideo(videoUrlOrId.toID())
|
||||
PlayingQueue.clear()
|
||||
// maximize player
|
||||
this.binding.playerMotionLayout.transitionToStart()
|
||||
true
|
||||
try {
|
||||
this.playNextVideo(videoUrlOrId.toID())
|
||||
// maximize player
|
||||
this.binding.playerMotionLayout.transitionToStart()
|
||||
PlayingQueue.clear()
|
||||
true
|
||||
} catch (e: Exception) {
|
||||
this.onDestroy()
|
||||
false
|
||||
}
|
||||
}
|
||||
if (attachedToRunningPlayer) return
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user