Skip to content

Commit f51885f

Browse files
authored
Fix MotionEvent gestures getting stuck in player (#2629)
1 parent 31165a8 commit f51885f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/src/main/java/com/lagradost/cloudstream3/ui/player/FullScreenPlayer.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
16601660
playerBinding?.playerIntroPlay?.isGone = true
16611661

16621662
// Handle pan with two fingers
1663-
if (event.pointerCount == 2 && !isLocked && isFullScreenPlayer && !hasTriggeredSpeedUp && currentTouchAction == null) {
1663+
if ((event.pointerCount == 2 || lastPan != null) && !isLocked && isFullScreenPlayer && !hasTriggeredSpeedUp && currentTouchAction == null) {
16641664
holdhandler.removeCallbacks(holdRunnable) // remove 2x speed
16651665

16661666
// Gesture detectors for zoom & pan
@@ -1695,7 +1695,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
16951695
lastPan = newPan
16961696
}
16971697

1698-
MotionEvent.ACTION_POINTER_UP, MotionEvent.ACTION_UP -> {
1698+
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_POINTER_UP, MotionEvent.ACTION_UP -> {
16991699
// Reset touch
17001700
lastPan = null
17011701
currentTouchStart = null
@@ -1777,7 +1777,7 @@ open class FullScreenPlayer : AbstractPlayerFragment() {
17771777
}
17781778
}
17791779

1780-
MotionEvent.ACTION_UP -> {
1780+
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP -> {
17811781
holdhandler.removeCallbacks(holdRunnable)
17821782
if (hasTriggeredSpeedUp) {
17831783
player.setPlaybackSpeed(DataStoreHelper.playBackSpeed)

0 commit comments

Comments
 (0)