fix: crash when starting next video before current started

This commit is contained in:
Bnyro 2024-12-02 21:24:01 +01:00
parent fabcdc02a6
commit c881b6ff5c

View File

@ -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