Skip to content

Conversation

@aricodeine
Copy link
Contributor

… 2x and reverts when hold gesture ends

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

  • Added a listener that detects for touch and hold event to add a 2x playback speed runnable

Tests performed

Tested on Nothing Phone 2A and API 36.0 Emulator

Preview

Recording.2025-11-18.232202.mp4

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • All checks are passing.

Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It mostly works, but there are some issues:

  1. Pinch to zoom ➜ playback speed is permanently set to 2x
    • Long press ➜ playback speed is set to 2x ➜ perform pinch to zoom without lifting the initial/first touch pointer ➜ playback speed is permanently set to 2x
  2. Increase volume/brightness using vertical gestures ➜ move the touch pointer to the center of the screen without lifting it ➜ playback speed is set to 2x and it shouldn't be (this is a minor issue)
  3. There's a separate player (VideoPlayerActivity) that can be activated in app settings (Always open videos on a separate screen with new horizontal gestures). This functionality should also be added there (as long as it doesn't conflict with the seek gestures there)

Additional suggestion:

The playback speed button already reflects the speed in the standard case, but it would be nice to show a 2x>> pill at the top when speed is boosted in full-screen mode. You can check YouTube to see how that works.

@aricodeine
Copy link
Contributor Author

  1. There's a separate player (VideoPlayerActivity) that can be activated in app settings (Always open videos on a separate screen with new horizontal gestures). This functionality should also be added there (as long as it doesn't conflict with the seek gestures there)

@naveensingh the new player uses long press gesture to skip the video forward/backward so not sure how we could integrate this long press 2x playback speed feature into the other player

@naveensingh
Copy link
Member

We could increase the speed as long movement is smaller than the touch slop, but it's a nice-to-have. Not necessary for this PR.

@aricodeine
Copy link
Contributor Author

I have implemented that pill shaped representation of the 2x playback speed long press feature just like Youtube app.

  1. Increase volume/brightness using vertical gestures ➜ move the touch pointer to the center of the screen without lifting it ➜ playback speed is set to 2x and it shouldn't be (this is a minor issue)

This one I tried to fix, but I think it's not fixed completely, will take another jab at it.

@aricodeine
Copy link
Contributor Author

It mostly works, but there are some issues:

  1. Pinch to zoom ➜ playback speed is permanently set to 2x

    • Long press ➜ playback speed is set to 2x ➜ perform pinch to zoom without lifting the initial/first touch pointer ➜ playback speed is permanently set to 2x
  2. Increase volume/brightness using vertical gestures ➜ move the touch pointer to the center of the screen without lifting it ➜ playback speed is set to 2x and it shouldn't be (this is a minor issue)

  3. There's a separate player (VideoPlayerActivity) that can be activated in app settings (Always open videos on a separate screen with new horizontal gestures). This functionality should also be added there (as long as it doesn't conflict with the seek gestures there)

Additional suggestion:

The playback speed button already reflects the speed in the standard case, but it would be nice to show a 2x>> pill at the top when speed is boosted in full-screen mode. You can check YouTube to see how that works.

@naveensingh 1,2 and 2x playback pill implementation is done. Please review.

Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two more bugs:

  1. Zooming in still activates speed boost. It shouldn't be activated when more than one touch pointer is detected.
  2. When zoomed in, it's not possible to pan using one or two pointers without activating speed boost.

I think a 500ms delay will be safer. Also, it'll be nice to provide haptic feedback when the gesture is finally activated (i.e., call mView.performHapticFeedback(HapticFeedbackConstants.LONG_PRESS) in the runnable).

@aricodeine
Copy link
Contributor Author

  1. When zoomed in, it's not possible to pan using one or two pointers without activating speed boost.

@naveensingh do we want to allow triggering 2x speed gesture if the zoom level is not 1f? We can allow it as a nice-to-have but Youtube does not have it.

@naveensingh
Copy link
Member

@naveensingh do we want to allow triggering 2x speed gesture if the zoom level is not 1f? We can allow it as a nice-to-have but Youtube does not have it.

Yes, we should allow it. Someone might report it as a bug if we don't.

@aricodeine
Copy link
Contributor Author

aricodeine commented Dec 6, 2025

@naveensingh do we want to allow triggering 2x speed gesture if the zoom level is not 1f? We can allow it as a nice-to-have but Youtube does not have it.

Yes, we should allow it. Someone might report it as a bug if we don't.

@naveensingh
What should happen when the zoom level is not 1f and the user has already triggered 2x speed feature and then tries to move around the screen? Should we cancel the 2x speed in this case and let the user pan?

@naveensingh
Copy link
Member

naveensingh commented Dec 6, 2025

What should happen when the zoom level is not 1f and the user has already triggered 2x speed feature and then tries to move around the held single touch? Should we cancel the 2x speed in this case and let the user pan?

I don't think so. It should work like the following:

  • Long press detected for 500ms without movement ➜ Activate speed boost (with haptic feedback) ➜ Disable zoom and pan while speed boost is active.
  • Long press detected with movement ➜ Zoom or pan as usual. No speed boost.

That is, it's a mode that users enter/exit manually.

@aricodeine
Copy link
Contributor Author

@naveensingh changes are done, please review.

@naveensingh naveensingh changed the title Gallery issue 666 feat: implement long press to play videos at 2x speed Dec 8, 2025
Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works nicely, thanks!

@naveensingh naveensingh merged commit 3cefd4d into FossifyOrg:main Dec 8, 2025
7 checks passed
@naveensingh naveensingh changed the title feat: implement long press to play videos at 2x speed feat: implement long press gesture to play videos at 2x speed Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request] Add Long Press Gesture To 2x Speed in Video Player

2 participants