Repository navigation
fix(player): respect user defined auto-hide delay and add Never option - #255
sonnayasomnambula wants to merge 13 commits into
Conversation
…s auto-hide delay
Reviewer's GuideData structuresDefine the shared auto-hide delay sentinel values, valid slider range, and layout-specific defaults used by preferences and playback behavior.
ImplementationUse the shared delay values to resolve Default per layout, preserve the locked-controls timeout, and leave controls visible for Never.
UIReplace the old timeout choices and custom-entry dialog with a slider for Default, Never, and custom delays, and move the preference into Behavior.
Rename the searchable preference key to its Behavior location and include delay and Never-related search terms.
DocumentationRecord the new delay selector and the layouts' adherence to the configured auto-hide delay in the unreleased changelog.
Other changesFiles not grouped.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 6 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt" line_range="328" />
<code_context>
+ isModern -> ControlsDisappearTimeout.Defaults.MODERN
+ else -> ControlsDisappearTimeout.Defaults.CLASSIC
+ }
+ else -> playerTimeToDisappear // or user pref
+ }
+
</code_context>
<issue_to_address>
**Changed delay leaves old timer active**
When the auto-hide preference changes while controls are shown and the effect is running, `LaunchedEffect` reads `playerTimeToDisappear` without using it as a key, so the active timer is not canceled or restarted; controls hide according to the old delay, or a timer does not start when changing from Never to a timed option.
Add `playerTimeToDisappear` to the `LaunchedEffect` keys so preference changes cancel and recalculate the timer.
</issue_to_address>
### Comment 2
<location path="app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt" line_range="321" />
<code_context>
- isTv -> 5000L
- isModern -> 2500L
- else -> playerTimeToDisappear.toLong()
+ areControlsLocked -> ControlsDisappearTimeout.Defaults.LOCKED
+ playerTimeToDisappear == ControlsDisappearTimeout.NEVER -> 0
+ playerTimeToDisappear == ControlsDisappearTimeout.DEFAULT -> when {
</code_context>
<issue_to_address>
**Never still hides locked controls**
When controls are locked during playback and Never is selected, `areControlsLocked` selects the locked timeout before the Never check, so `hideControls()` runs after two seconds and the controls disappear despite the user's setting.
Check for Never before selecting the locked-controls timeout.
Also at `app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt:322`.
</issue_to_address>
### Comment 3
<location path="app/src/main/java/app/aryan447/mpvium/domain/player/ControlsDisappearTimeout.kt" line_range="8" />
<code_context>
+ const val NEVER = 0
+
+ object Constraints {
+ const val MIN = 500
+ const val MAX = 1000000000000
+ }
</code_context>
<issue_to_address>
**Saved short delays no longer hide controls**
When an installation has a saved custom delay between 100 and 499 ms, the new 500 ms minimum excludes these previously accepted values, so `PlayerControls` skips both `delay` and `hideControls()` and the controls remain visible.
Allow existing 100–499 ms delays through the runtime check, or migrate them to a valid delay before applying the check.
Also at `app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt:331`.
</issue_to_address>
### Comment 4
<location path="app/src/main/java/app/aryan447/mpvium/ui/preferences/PlayerControlsPreferencesScreen.kt" line_range="422" />
<code_context>
+ AutoHideOption.Never -> playerPrefs.playerTimeToDisappear.set(ControlsDisappearTimeout.NEVER)
+ AutoHideOption.Custom -> {
+ if (playerTimeToDisappear >= ControlsDisappearTimeout.Constraints.MIN) {
+ playerTimeToDisappear.toString()
+ } else {
+ ControlsDisappearTimeout.Defaults.CLASSIC
</code_context>
<issue_to_address>
**Custom delay field loses its value**
When the user selects Custom, the Custom branch evaluates the saved delay or fallback but never assigns it to `customTimeValue`, so the dialog opens blank or retains a canceled draft; users must re-enter the configured value to edit it.
Assign the saved delay or fallback to `customTimeValue` whenever Custom is selected.
</issue_to_address>
### Comment 5
<location path="app/src/main/res/values/strings.xml" line_range="635" />
<code_context>
<string name="swap_the_volume_and_brightness_slider">Swap volume and brightness slider</string>
<string name="pref_player_display_reduce_player_animation">Reduce player animation</string>
- <string name="pref_player_display_hide_player_control_time">Hide player control time</string>
+ <string name="pref_player_display_hide_player_control_time">Controls auto-hide delay</string>
<string name="show_splash_ovals_on_double_tap_to_seek">Show ripple when double tap seeking</string>
<string name="show_time_on_double_tap_to_seek">Show seek time</string>
</code_context>
<issue_to_address>
**Localized label describes wrong setting**
When the app is displayed in a locale other than English or Russian, users selecting one of the other translated resources still see wording about hiding the time on player controls, so the label misdescribes the new auto-hide-delay preference.
Update the corresponding translated `pref_player_display_hide_player_control_time` strings to describe the controls auto-hide delay.
</issue_to_address>
### Comment 6
<location path="app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt" line_range="328" />
<code_context>
+ isModern -> ControlsDisappearTimeout.Defaults.MODERN
+ else -> ControlsDisappearTimeout.Defaults.CLASSIC
+ }
+ else -> playerTimeToDisappear // or user pref
+ }
+
</code_context>
<issue_to_address>
**Release changelog stays stale**
When this user-visible auto-hide behavior is introduced, the new auto-hide behavior is recorded in `UNRELEASED.md` but not `CHANGELOG.md`, so the required corresponding entry in the source-of-truth release notes is missing.
Add corresponding user-facing notes to `CHANGELOG.md` in the same change.
</issue_to_address>Sourcery assessment
Needs a human reviewer. 4 findings to address first, and choosing Never stores 0 in the existing preference, and that value survives an app rollback; the old implementation interprets it as a zero-delay hide, so controls may disappear until the user changes the setting. The effect is limited to this preference and is repairable in the settings.
Blocking findings: app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt:328, app/src/main/java/app/aryan447/mpvium/ui/player/controls/PlayerControls.kt:321, app/src/main/java/app/aryan447/mpvium/domain/player/ControlsDisappearTimeout.kt:8, app/src/main/java/app/aryan447/mpvium/ui/preferences/PlayerControlsPreferencesScreen.kt:422
|
My first impulse was simply to remove the hardcoded constants — it felt confusing when my custom setting was silently ignored. However, after 1.6 was released and I gave it a bit more thought, I came up with what I hope is a cleaner approach that aligns well with the "Sane defaults, pro-level control" motto. Please review this PR carefully — Kotlin isn't really my "native" language, and Android/Gradle aren't quite my home turf either. Let me know if any packages, enums, or constants are placed in an inappropriate location or need better naming. |
|
Thanks for the PR! A few small notes before merging:
|
|
The slider looks better, yes — it's much easier to hit a value on a TV remote than a numeric keyboard, and dropping the icon in favour of a clean row helps too. Let's go with it. Two things:
On the cap: keep a single One bonus of the slider: the 500 ms floor is enforced by the control itself, so the earlier problem of the OK button silently doing nothing on an invalid value goes away with it. |
|
That actually works cleanly as a single inline slider instead of a 3-option picker + a dialog with a text field, OK, and Cancel, if we start the range at
One quick question: should we use this inline slider for TV only (keeping the picker + dialog for Modern/Classic), or replace the setting with this slider across all layouts? |
|
Slider everywhere — one code path, one behaviour to test, one set of strings. Keeping the picker + dialog for Modern/Classic means two UIs that drift apart, and the dialog isn't better on a phone anyway: any non-preset value already costs a tap, a keyboard, and an OK. The slider reads fine on touch too, so there's no reason to split it. Two things to keep in mind with
Either way, the One more thing — are you around anywhere else, like Discord, Telegram, or email? A lot of this would be faster to hash out in chat than in comment rounds, and I'd rather have you reachable while the slider and the reset land. |
|
Thanks for the invite — it's very flattering, though I feel more comfortable communicating here, where I always have time to think things through. The first idea isn't always the best one, which this thread itself shows pretty clearly. Even right now: I'm mostly ready to update the PR, but I want to test the build at home first. For instance, I'm not sure the Reset button should be placed to the right of the slider — would a D-Pad even be able to focus it when pressing right adjusts the slider? |
|
Completely fair — keeping everything here on GitHub works great, and you're right that taking the time to think it through led Good catch on the Reset placement too. In Compose Material 3, a focused Slider consumes DirectionLeft / DirectionRight to scrub Putting the Reset button above or below the slider instead (for example, right-aligned in the title/summary row above the Take your time testing on your devices at home, and just ping when you've pushed the update! |
…der, search keywords)
# Conflicts: # UNRELEASED.md
|
Hi @Aryan447! Keyword search and navigation to the target section work — I've tested this on both mobile and TV. As a side note, the highlighting effect in the light theme is so subtle that I initially thought I had broken the indices and rushed to dig into the code responsible for it. Then it occurred to me to temporarily modify I fixed the indices for the TV layout on the screen I was working on. I didn't touch the other screens so as not to delay or clutter the PR. I can already see a couple of spots that need fixing in A couple of things I also noticed:
Neither of these two points seems significant enough to open a separate issue for at this stage, but I still wanted to share them. P.S. Sorry for the noisy import changes. |
|
Looks really clean — the slider + Reset button below it works nicely, and the screenshot looks great! Thanks for keeping the PR focused by only fixing the TV highlight indices on Good catches on the rest too:
No worries at all on the imports or merge conflicts. Once the CI checks finish up, I'll take a final look and get this merged! |
…lt (Aryan447#264) Previously users could only toggle the dark gradient vignette on or off behind player controls. Replace the vignette switch with a 3-way Controls backdrop setting (Blur, Vignette, Off, defaulting to Blur) that renders a TextureView video surface inside Compose on Android 13+ with BlurRadiusSpec progressive blur behind the top and bottom controls while keeping SurfaceView for Vignette, Off, and Android 8-12. Unmeasured.
Android system media volume typically jumps in ~6-7% steps (e.g. 53% to 60% on 15-step devices), leaving no way to dial intermediate levels. Add an opt-in Precise volume toggle (off by default) under Player -> Gestures that maps 1% touch-gesture targets to the ceiling system step plus mpv software volume attenuation (1..100), while hardware volume buttons continue snapping directly to system volume steps. Unmeasured
…ing (Aryan447#271) * feat(app): add LAN companion remote, handoff, and cross-device streaming Add local-network Companion Mode so a phone can control a tablet or TV on the same Wi-Fi/LAN, browse and stream titles in both directions, and hand off playback at the exact timestamp. Uses Android NSD (_mpvium._tcp.), NanoHTTPD with Range 206 streaming and SSE state updates, 4-digit PIN pairing, a haptic jog wheel and gesture touchpad, second-screen track/subtitle/MediaInfo/Anime4K controls, URL throwing, and Late-Night Private Audio. * fix(app): resolve Compose TV modifier and mpv command signatures in companion UI * fix(app): use existing R.string.close in CompanionScreen



Summary
strings.xmlresources.Tested on
Samsung Galaxy Z Flip 5 (Android 16 / One UI 8.0)
Summary by Sourcery
Let users choose when player controls auto-hide, including keeping them visible until manually hidden.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Chores: