mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
Resize the PiP window when the next video starts playing
This commit is contained in:
parent
6ba6cca120
commit
be655e0dec
@ -278,7 +278,7 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
binding.playerMotionLayout.transitionToStart()
|
binding.playerMotionLayout.transitionToStart()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usePiP()) (activity as MainActivity).setPictureInPictureParams(getPipParams())
|
if (usePiP()) activity?.setPictureInPictureParams(getPipParams())
|
||||||
|
|
||||||
if (SDK_INT < Build.VERSION_CODES.O) {
|
if (SDK_INT < Build.VERSION_CODES.O) {
|
||||||
binding.relPlayerPip.visibility = View.GONE
|
binding.relPlayerPip.visibility = View.GONE
|
||||||
@ -824,6 +824,8 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
// media actually playing
|
// media actually playing
|
||||||
transitioning = false
|
transitioning = false
|
||||||
binding.playImageView.setImageResource(R.drawable.ic_pause)
|
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 -> {
|
Player.STATE_ENDED -> {
|
||||||
// video has finished
|
// video has finished
|
||||||
@ -1361,8 +1363,10 @@ class PlayerFragment : BaseFragment(), OnlinePlayerOptions {
|
|||||||
if (SDK_INT >= Build.VERSION_CODES.S) {
|
if (SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
setAutoEnterEnabled(true)
|
setAutoEnterEnabled(true)
|
||||||
}
|
}
|
||||||
|
if (exoPlayer.isPlaying) {
|
||||||
|
setAspectRatio(exoPlayer.videoSize.width, exoPlayer.videoSize.height)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.setAspectRatio(exoPlayer.videoSize.width, exoPlayer.videoSize.height)
|
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
private fun shouldStartPiP(): Boolean {
|
private fun shouldStartPiP(): Boolean {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user