Skip to content

Add 2x speed hold for mobile and desktop#187

Open
fivepandasna wants to merge 2 commits into
Moonfin-Client:mainfrom
fivepandasna:2x-mobile
Open

Add 2x speed hold for mobile and desktop#187
fivepandasna wants to merge 2 commits into
Moonfin-Client:mainfrom
fivepandasna:2x-mobile

Conversation

@fivepandasna
Copy link
Copy Markdown

@fivepandasna fivepandasna commented May 9, 2026

Summary

Adds long-press 2x speed hold for mobile and extends the existing TV speed hold to desktop. Includes minor renames to reflect that the speed constant and restore method are now shared across supported platforms.

Related Issues

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

  • Add _mobileTemporarySpeedHoldActive / _mobileTemporarySpeedRestoreSpeed state variables for mobile hold tracking
  • Add _canUseMobileTemporarySpeedHold, _activateMobileTemporarySpeedHold, and _cancelMobileTemporarySpeedHold to implement long-press 2x speed on mobile
  • Wire onLongPress / onLongPressEnd on the main GestureDetector to activate/cancel the mobile speed hold
  • Cancel the hide timer during mobile speed hold so the OSD cannot auto-lock while the finger is down; reschedule it on release
  • Extend _canUseTvTemporarySpeedHold and the key event handler to include useDesktopUi, enabling the media key hold for 2× speed on desktop
  • Call _cancelMobileTemporarySpeedHold in dispose and didChangeAppLifecycleState to clean up properly
  • Rename _tvTemporarySpeed_temporarySpeed and _restoreTvTemporarySpeed_restoreTemporarySpeed since both are now shared across TV, mobile, and desktop

Platform

  • Android
  • iOS
  • macOS
  • Windows
  • Linux
  • All / Shared code

Testing

  • Tested on emulator / simulator
  • Tested on physical device
  • Manual testing completed
  • Not tested (explain why):

Test Steps

  1. Start playing a video on mobile
  2. Long-press the screen and verify playback switches to 2x speed
  3. Release and verify speed restores and OSD auto-hides normally
  4. On desktop, hold the media pause / play-pause key and verify 2x speed activates; release to verify it restores

Screenshots (if applicable)

N/A

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

Notes

There should probably be some sort of indicator for when the video is on 2x speed, maybe near the top of the player. It may also be a good idea to use the space bar/left click on desktop for 2x, but I left it to media keys for now.

I also had some troubles with unlocking the OSD during testing, however I also experienced these on stable 1.4.0, so I don't think they're related to these changes.

@fivepandasna
Copy link
Copy Markdown
Author

I thought that builds were fine but I was looking at a workflow run from before I amended a commit, apologies. I fixed the build error and retested on iOS, all is the same. I will test again on Windows and update if there are any issues, but there shouldn't be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant