Repository navigation
feat(player): drag subtitles to reposition them - #2067
Open
SairamVemula wants to merge 10 commits into
Open
SairamVemula wants to merge 10 commits into
SairamVemula wants to merge 10 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
awaitLongPressOrCancellation gives up when the tap detector has already consumed the down event, so the drag never started on a device. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Playback keeps running. The grey box, haptic tick and hidden controls tell the user the long-press landed on the subtitle. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
No long-press delay. The move that crosses the touch slop is consumed so the volume, brightness and seek swipes do not start on it as well. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The touch area was a fixed strip at the bottom of the screen. Measure where the subtitle view actually draws text and hit-test against that instead. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Drop the horizontal offset; subtitles stay centred and only move up or down. Update the reset item description to match. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Subtitles are always drawn at the bottom of the screen. There is no way to move them out of the way of burned-in text or to put them where they are comfortable to read. This has been asked for repeatedly.
Solution
Touch a subtitle and drag your finger up or down to move it. The position is saved and used for every video. Subtitles only move vertically and stay centred horizontally.
subtitleOffsetYinPlayerPreferences, saved as a fraction of the player height so the position holds across rotation and screen sizes. The offset is clamped so the subtitle cannot leave the screen and is ignored in picture-in-picture.Closes #1413, closes #1528, closes #1598. Related to #1327, #1576.
Verification
ktlintCheckandassembleDebugpass. New unit tests:SubtitlePositionStateTest(offset maths, clamping, saving, hit-testing against the drawn text, highlight state) and aPlayerViewModelTestcase for saving the offset.testhas 6 failures that are not related to this change and fail the same way on an unmodifiedmain(1cf4c4ac): 4 inGetFolderTreeMediaUseCaseTest, 1 inPlaylistDetailViewModelTest, 1 inM3UParserTest.Manual testing
Medium_Phone_API_37.0(API 37, x86_64), landscape video with an embedded subtitle track:release-with-debug-signingbuild and used it with real videos; behaves as above.Not covered: image-based subtitles (PGS/DVD), picture-in-picture, and rotating with a saved position on a device. Before/after screenshots can be added as a comment.
🤖 Generated with Claude Code