feat: Add Subtitle Offset Setting to Android TV App - #108
Closed
EierKopZA wants to merge 3 commits into
Closed
Conversation
Collaborator
|
Great feature addition. The subtitle offset setting is a useful quality-of-life improvement and fits naturally with the existing subtitle controls. One small technical note: ensure the subtitle offset is applied in both the player view initialization and the update path, so changes take effect immediately during playback without needing to recreate the player view. |
Owner
|
Thanks for this PR — the subtitle offset feature itself looks good and CI was green. However, after merging #120 (UI Mode Warning Dialog), this branch now conflicts with To unblock merge, please:
Once rebased with correct focus indices, this should be ready to merge. |
ProdigyV21
pushed a commit
that referenced
this pull request
Apr 5, 2026
Reported: "On Fire Stick the remote button rewind/ffwd/play/pause buttons don't work with the player." Root cause: Only `Key.MediaPlayPause` / `MediaPlay` / `MediaPause` was handled in PlayerScreen.kt, and only inside the `if (showSubtitleMenu)` branch \u2014 so media keys did nothing unless the user had already opened the audio/subtitle menu. `Key.MediaRewind`, `MediaFastForward`, `MediaNext`, `MediaPrevious`, and `MediaStop` were not handled at all, anywhere. Fire TV Stick remotes ship with dedicated FF/RW/Play buttons and Amazon explicitly recommends apps handle them via the standard KeyEvent constants. Bluetooth A2DP headsets and keyboards also produce these keys. ARVIO was dropping all of them on the floor. Fix: add a top-level media-key dispatch at the very start of the player `.onKeyEvent` handler, BEFORE the error / menu / overlay branches. Each key returns `true` immediately so it always wins regardless of whether a menu is open. Handles: - `Key.MediaPlayPause` \u2192 toggle play/pause, show controls. - `Key.MediaPlay` \u2192 play, show controls. - `Key.MediaPause` \u2192 pause, show controls. - `Key.MediaStop` \u2192 pause and exit the player (equivalent to Back). - `Key.MediaRewind` \u2192 seek back 10 seconds via existing queueControlsSeek. - `Key.MediaFastForward` \u2192 seek forward 10 seconds. - `Key.MediaNext` \u2192 jump to the next episode (TV only). Uses the same onPlayNext lambda the existing Next Episode button uses, so the binge-group / source-preservation logic is identical. - `Key.MediaPrevious` \u2192 jump to the previous episode (TV only, guarded by `episodeNumber > 1`). The existing `Key.MediaPlayPause` branch inside the subtitle menu remains in place as a harmless safety net \u2014 it becomes unreachable in practice because the top-level dispatch already returns true, but leaving it means a future change to the top handler can't accidentally break media keys inside the subtitle menu. Closes the Fire TV remote part of #68. The other parts of #68 (subtitle timing sync, in-player episode picker) are scoped separately. Subtitle offset is already being shipped in PR #108.
ProdigyV21
added a commit
that referenced
this pull request
Apr 5, 2026
#133) Reported: "On Fire Stick the remote button rewind/ffwd/play/pause buttons don't work with the player." Root cause: Only `Key.MediaPlayPause` / `MediaPlay` / `MediaPause` was handled in PlayerScreen.kt, and only inside the `if (showSubtitleMenu)` branch \u2014 so media keys did nothing unless the user had already opened the audio/subtitle menu. `Key.MediaRewind`, `MediaFastForward`, `MediaNext`, `MediaPrevious`, and `MediaStop` were not handled at all, anywhere. Fire TV Stick remotes ship with dedicated FF/RW/Play buttons and Amazon explicitly recommends apps handle them via the standard KeyEvent constants. Bluetooth A2DP headsets and keyboards also produce these keys. ARVIO was dropping all of them on the floor. Fix: add a top-level media-key dispatch at the very start of the player `.onKeyEvent` handler, BEFORE the error / menu / overlay branches. Each key returns `true` immediately so it always wins regardless of whether a menu is open. Handles: - `Key.MediaPlayPause` \u2192 toggle play/pause, show controls. - `Key.MediaPlay` \u2192 play, show controls. - `Key.MediaPause` \u2192 pause, show controls. - `Key.MediaStop` \u2192 pause and exit the player (equivalent to Back). - `Key.MediaRewind` \u2192 seek back 10 seconds via existing queueControlsSeek. - `Key.MediaFastForward` \u2192 seek forward 10 seconds. - `Key.MediaNext` \u2192 jump to the next episode (TV only). Uses the same onPlayNext lambda the existing Next Episode button uses, so the binge-group / source-preservation logic is identical. - `Key.MediaPrevious` \u2192 jump to the previous episode (TV only, guarded by `episodeNumber > 1`). The existing `Key.MediaPlayPause` branch inside the subtitle menu remains in place as a harmless safety net \u2014 it becomes unreachable in practice because the top-level dispatch already returns true, but leaving it means a future change to the top handler can't accidentally break media keys inside the subtitle menu. Closes the Fire TV remote part of #68. The other parts of #68 (subtitle timing sync, in-player episode picker) are scoped separately. Subtitle offset is already being shipped in PR #108. Co-authored-by: Arvin <arvin@arflix.local>
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 pull request adds a new quality-of-life feature allowing users to vertically offset their subtitles on the screen during playback.
Some users prefer subtitles sitting lower out of the active content edge, or slightly higher to match external borders. To accommodate this, a 5-step configurable "Subtitle Offset" setting has been added alongside existing options (Subtitle Color, Subtitle Size).
Changes Made:
subtitleOffsetDataStore preference mapping inSettingsViewModelandPlayerViewModel.SettingsRowwithinGeneralSettingssection inside theSettingsScreenUI layer.setBottomPaddingFractionwithinPlayerScreen.kt, dynamically reacting to the offset fractions (0.02fto0.18f) requested.No existing settings routines or ExoPlayer dependencies were modified or broken.