Feature/increase subtitle offset - #673
Open
AndreOliveira23 wants to merge 3 commits into
Open
Conversation
Currently, the max offset is 10 seconds. This PR introduces variables to control both the offset and the step (both in MS).
Currently, the max offset is 10 seconds. This PR introduces variables to control both the offset and the step (both in MS).
…' into feature/increase-subtitle-offset # Conflicts: # app/src/main/kotlin/com/arflix/tv/ui/screens/player/PlayerScreen.kt
Owner
|
Thanks for working on this! Have you personally run into subtitles being more than 10 seconds out of sync, where choosing another subtitle track did not solve it? I have not encountered this myself, and most sources I use offer several subtitle options, so I would like to understand how often it happens and when the larger range would help. A real example would be useful. If we go ahead, please also update the mobile controls, which still stop at +/-10 seconds. |
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.
Description
This PR increases the maximum subtitle synchronization offset from ±10 seconds to ±120 seconds, allowing users to better adjust out-of-sync subtitles while maintaining the precise 100ms adjustment steps.
Changes Included:
Constants Extraction: app/src/main/kotlin/com/arflix/tv/ui/screens/player/PlayerScreen.kt: Replaced hardcoded magic numbers by introducing MAX_SUBTITLE_OFFSET_MS = 120L and SUBTITLE_OFFSET_STEP_MS = 100L to improve code maintainability.
D-Pad Navigation: Updated the Key.DirectionLeft and Key.DirectionRight event handlers in the subtitle settings panel to use the new ±100s boundary limits (coerceAtLeast and coerceAtMost).
On-Screen Controls: Updated the onOffsetDecrease and onOffsetIncrease callbacks inside the PlayerSubtitleSettingsPanel invocation to match the expanded limits.
Closes #595