Repository navigation
Android parity and open-issues sweep - #36
Conversation
Bring the phone player's end-of-episode flow to parity with Android TV. Instead of instantly auto-advancing at the credits marker (with a bare "Next Episode" button and a "Still watching?" dialog), the player now surfaces a dismissible Up Next card with the next episode's still, title, and runtime, plus a visible 10s countdown that auto-plays at zero. - PlayerViewModel: NextEpisodeInfo state (full EpisodeListItem fields), showUpNext/upNextVideoEnded/upNextCountdownSeconds card state, and a TV-mirroring onApproachingEnd/commitApproachingEnd/countdown flow with the pending re-arm for late next-episode resolution. Pass-out semantics match TV: shouldGate() at commit (gated or auto-play off = card without countdown), recordAutoAdvance() only on unattended countdown expiry, Play Now resets the streak. Watch Together rooms never show the card. - Trigger: credits-marker crossing wins when present; otherwise the card fires when crossing (duration - nextUpPromptSeconds) with the same before->after transition guard (0 = only at end, iOS parity); STATE_ENDED remains the fallback and upgrades the card label. - New UpNextCard composable: compact dark card bottom-end with ThumbhashImage still, "UP NEXT"/"PLAYING NEXT" eyebrow, runtime, "Play Now · N" countdown button, and a dismiss affordance. Replaces the StillWatchingPrompt dialog and the bare Next Episode button. - Settings: "Auto-Play Next Episode" switch and "Show Next Up" prompt-seconds dropdown in the phone Playback section, wired to the existing per-profile, server-synced store keys (labels mirror TV). Phone-only; no shared or TV module changes. Refs #23 Co-Authored-By: Claude Fable 5 <[email protected]>
Two audit fixes for the phone Up Next card: - The countdown on the credits/prompt-crossing path is now derived from the remaining playback time and only advances once the player reports STATE_ENDED (iOS parity), instead of a fixed 10s wall-clock timer that could truncate up to ~110s of an episode with no credits marker. The 10s wall-clock countdown is kept only for cards committed at STATE_ENDED, where no playback remains to anchor to. - Deliberate transport actions now interact with the non-modal card: pausing cancels the auto-advance countdown (card stays up without a countdown), and a user seek while the card is showing dismisses it, so the player can no longer yank a paused or rewatching user to the next episode. Room-driven seeks (seekImmediate) are unaffected. Co-Authored-By: Claude Fable 5 <[email protected]>
… recovery Findings from a code survey of seven open-source Android players (jellyfin-androidtv, Findroid, jellyfin-android, Streamyfin, NextPlayer, Just Player, mpv-android), written up in docs/media3/10. - Mobile player-error recovery (parity with TV): wire onPlayerError and PlaybackRecoveryPlanner into PlayerViewModel — bounded transient-network same-route retry, alternate direct engine with attemptedEngines guard and route-event telemetry, then server remux/transcode, single-flighted. Previously decoder/IO failures were dropped and every preflight issue forced a FULL transcode. - Dolby Vision Profile 7: allow native direct play when the decoder claims dual-layer DV with multi-instance HEVC (the probe's existing gate); DisplayHdrProbe no longer strips P7 from the panel intersection (Android panels can't report per-profile DV support). Non-native P7 now prefers an alternate direct engine (mpv renders the HDR10 base layer) over transcode, and never remuxes (a remux re-sends the same rejected stream). - mpv audio passthrough: default ao is now audiotrack,aaudio — mpv's AAudio AO cannot open IEC61937 streams, so audio-spdif passthrough silently decoded Atmos/TrueHD to PCM under aaudio. - mpv hwdec: direct-first (mediacodec,mediacodec-copy) instead of forced copy-back, halving decode memory bandwidth on 4K. - TS extractor hardening: FLAG_ENABLE_HDMV_DTS_AUDIO_STREAMS and a 1500-packet timestamp search window for Blu-ray-sourced M2TS and high-bitrate transport streams. Server follow-up: the resolver still emits dolby_vision_profile_7_not_launch_claimed, which preempts the new client ladder; it should stop blocking P7 (or offer MPV_DIRECT as a fallback) now that clients claim and handle it honestly. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AaKRXz1mtnsDm6pn1LDkmz
# Conflicts: # androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt # androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt # androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/PlaybackSettings.kt # androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsScreen.kt # androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/SettingsViewModel.kt
|
Important Review skippedToo many files! This PR contains 227 files, which is 77 over the limit of 150. To get a review, narrow the scope: Upgrade to a paid plan to raise the limit. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (227)
You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 45f24b64ce
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private fun notificationRouteOrNull(intent: Intent?): String? = | ||
| intent | ||
| ?.getStringExtra(PushNotificationPresenter.EXTRA_NAV_ROUTE) | ||
| ?.trim() | ||
| ?.takeIf { it.isNotEmpty() } |
There was a problem hiding this comment.
Validate external notification routes
Because MainActivity is exported, another app can start it with EXTRA_NAV_ROUTE; this helper accepts any non-empty string and AppNavigation later passes it directly to navController.navigate(route). An arbitrary unknown route crashes the app, and known hidden routes such as requests/player/watch-together can be opened without going through the intended UI gates. Restrict this to an allowlist of notification routes or otherwise verify the intent was produced by the app before navigating.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 25e6e67. Notification extras now go through notificationNavigationRouteOrNull, which only allows inbox and item/<id> routes; player, requests, watch-together, malformed item routes, and arbitrary strings are dropped. Added NotificationNavigationRoutesTest for the allowlist.
| val requestsMenuAction: (() -> Unit)? = if (requestsEnabled) { | ||
| { navController.navigate(Route.Requests.route) } |
There was a problem hiding this comment.
Keep Requests out of phone menus
The repository exposure rules say Requests are not currently accessible on Android phone, but this now turns a positive server /requests/status response into a visible menu action. On any server with requests enabled, the phone Home/Libraries/top-bar menus will expose Route.Requests without a client-side product switch, so keep this null or behind the existing client exposure policy until the surface is approved.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving this visible intentionally. Product direction is Apple parity: Requests should be exposed on Android when the server reports requests enabled. Admin and Watch Together remain hidden from user menus; Requests is no longer part of the hidden-surface policy.
| state = SiloPictureInPicturePlaybackState( | ||
| enabled = pictureInPictureEnabled, | ||
| videoActive = uiState.streamUrl != null && !uiState.isLoading && uiState.error == null, | ||
| isPlaying = mediaController?.isPlaying == true && !uiState.isPaused, |
There was a problem hiding this comment.
Recompute mobile PiP params when playback starts
This value changes when the player transitions from prepared/buffering to actually playing, but the surrounding LaunchedEffect is not keyed on uiState.isPlaying (the field updated by onIsPlayingChanged). In the normal path the coordinator can cache isPlaying=false when streamUrl first appears, leaving canEnterPictureInPicture/auto-enter disabled until some unrelated key changes; key the effect on the playing state or derive the PiP state from the observed UI state.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 25e6e67. Mobile PiP state now keys on uiState.isPlaying and publishes isPlaying = uiState.isPlaying && !uiState.isPaused, so the coordinator refreshes when playback actually starts.
| state = SiloPictureInPicturePlaybackState( | ||
| enabled = pictureInPictureEnabled, | ||
| videoActive = state.streamUrl != null && !state.isLoading && state.error == null, | ||
| isPlaying = mediaController?.isPlaying == true && !state.isPaused, |
There was a problem hiding this comment.
Recompute TV PiP params when playback starts
This has the same stale-state problem as the phone player: mediaController?.isPlaying can flip after this effect has run, while the effect only keys on stream/loading/error/pause and never on state.isPlaying. On TV builds that support PiP, the coordinator may keep isPlaying=false, so leaving the app during active playback will not enter PiP until another dependency happens to update.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 25e6e67. TV PiP state now keys on state.isPlaying and publishes isPlaying = state.isPlaying && !state.isPaused, matching the phone-side fix.
Summary
This is the consolidated Android parity/open-issues PR. It supersedes the now-closed PRs #30 and #34, and also replaces the stale/conflicting resume-progress PR #2 with the newer branch state.
The branch brings Android mobile and Android TV closer to the current Apple clients while keeping Android-only capabilities where they already exist.
What changed
Requests parity
RequestsFeatureStoreand wires it through DI.requests_enabled.requests_enabled.Mobile parity and polish
Android TV parity and polish
Earlier consolidated player work
Includes the player work from the superseded branches, including:
Verification
Ran successfully:
Device smoke checks done during the branch
Notes for reviewers
main.