Merge pull request #4801 from Bnyro/master

fix: don't resume initial video on fragment recreation
This commit is contained in:
Bnyro 2023-09-17 15:30:19 +02:00 committed by GitHub
commit 8063a672de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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