mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
Fix synchronization of minimized player button
This commit is contained in:
parent
e925d72d0b
commit
d3d75d8bc8
@ -819,6 +819,14 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
||||
if (isPlaying) {
|
||||
// Stop [BackgroundMode] service if it is running.
|
||||
BackgroundHelper.stopBackgroundPlay(requireContext())
|
||||
// video is playing
|
||||
binding.playImageView.setImageResource(R.drawable.ic_pause)
|
||||
} else if (exoPlayer.playbackState == Player.STATE_ENDED) {
|
||||
// video has finished
|
||||
binding.playImageView.setImageResource(R.drawable.ic_restart)
|
||||
} else {
|
||||
// player in any other state
|
||||
binding.playImageView.setImageResource(R.drawable.ic_play)
|
||||
}
|
||||
|
||||
if (isPlaying && PlayerHelper.sponsorBlockEnabled) {
|
||||
@ -847,23 +855,12 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
||||
playNextVideo()
|
||||
}
|
||||
|
||||
when (playbackState) {
|
||||
Player.STATE_READY -> {
|
||||
if (playbackState == Player.STATE_READY) {
|
||||
// media actually playing
|
||||
transitioning = false
|
||||
binding.playImageView.setImageResource(R.drawable.ic_pause)
|
||||
// update the PiP params to use the correct aspect ratio
|
||||
if (usePiP()) activity?.setPictureInPictureParams(getPipParams())
|
||||
}
|
||||
Player.STATE_ENDED -> {
|
||||
// video has finished
|
||||
binding.playImageView.setImageResource(R.drawable.ic_restart)
|
||||
}
|
||||
else -> {
|
||||
// player in any other state
|
||||
binding.playImageView.setImageResource(R.drawable.ic_play)
|
||||
}
|
||||
}
|
||||
|
||||
// save the watch position when paused
|
||||
if (playbackState == PlaybackState.STATE_PAUSED) {
|
||||
|
Loading…
Reference in New Issue
Block a user