fix: don't resume initial video on fragment recreation

This commit is contained in:
Bnyro 2023-09-17 15:28:52 +02:00
parent 0b40039e96
commit 3cc6690220

View File

@ -841,6 +841,13 @@ class PlayerFragment : Fragment(), OnlinePlayerOptions {
isTransitioning = true
videoId = nextVideoId
// fix: if the fragment is recreated, play the current video, and not the initial one
arguments?.run {
val playerData = parcelable<PlayerData>(IntentData.playerData)!!.copy(videoId = videoId)
putParcelable(IntentData.playerData, playerData)
}
// start to play the next video
playVideo()
// close comment bottom sheet for next video