-
-
Notifications
You must be signed in to change notification settings - Fork 153
feat: implement long press gesture to play videos at 2x speed #787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… 2x and reverts when hold gesture ends
naveensingh
left a comment
There was a problem hiding this 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:
- 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
- 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)
- 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.
app/src/main/kotlin/org/fossify/gallery/fragments/VideoFragment.kt
Outdated
Show resolved
Hide resolved
@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 |
|
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. |
…ded pill-shaped representation when that same feature is triggered
…lery_issue_666 # Conflicts: # CHANGELOG.md
|
I have implemented that pill shaped representation of the 2x playback speed long press feature just like Youtube app.
This one I tried to fix, but I think it's not fixed completely, will take another jab at it. |
…lery into gallery_issue_659
…esture feature when touch is dragged towards the center during the vertical gesture
@naveensingh 1,2 and 2x playback pill implementation is done. Please review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two more bugs:
- Zooming in still activates speed boost. It shouldn't be activated when more than one touch pointer is detected.
- 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).
…lery into gallery_issue_659
@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 |
I don't think so. It should work like the following:
That is, it's a mode that users enter/exit manually. |
|
@naveensingh changes are done, please review. |
naveensingh
left a comment
There was a problem hiding this 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!
… 2x and reverts when hold gesture ends
Type of change(s)
What changed and why
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
CHANGELOG.md(if applicable).