Skip to content

feat(player): say when playback stopped because it was paused too long - #1043

Merged
Quick104 merged 4 commits into
mainfrom
feat/paused-playback-timeout
Nov 23, 2026
Merged

Quick104 merged 4 commits into
mainfrom
feat/paused-playback-timeout

Conversation

@Quick104

@Quick104 Quick104 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A

Validation tasks: none (no validated case covers a server ending a paused session)

Other clients: Apple Silo-Server/silo-apple#1261; Roku Silo-Server/silo-roku#107; Web Silo-Server/silo-server#5180

Silo-Server/silo-server#5180 lets an admin end playback that stays paused too long (default 15 minutes). Today the Android player treats that server answer as an administrator's end and shows "An administrator ended this playback session."

This advertises the new paused_timeout_v1 client feature on phone and TV video starts. When the server answers 410 playback_session_paused_timeout, the player leaves the way it does for an administrator's end, and shows the localized "Playback stopped because it was paused for too long." The server keeps the viewer's position.

Approach

  • PlaybackServerEnd (ADMIN, PAUSED_TIMEOUT) is read from the 410 problem code, and sessionEndedEvents carries the reason. The progress reporter checks it before the sequenced-progress branch, so a paused timeout never turns into "Playback progress is pending" or a renewal.
  • Phone and TV leave on a paused-timeout answer from progress, failure-recovery replans, seek reanchor and seek fallback, and the staged replans behind subtitle, audio and quality changes. Admin ends keep their current paths.
  • remoteStopRequests now carries UiText, so the paused-timeout notice comes from the string catalog. The admin notice text is unchanged.
  • playbackClientFeaturesV3(context, pausedTimeout) adds the feature only for the phone and TV video starters, and the attempt keeps the choice for its replans. Cast and audiobook starts, which share the list, don't send it.
  • No journal change was needed: a stop for an already-stopped attempt answers replayed with the stored receipt, which settles the session. A test covers it.

Validation

  • Unit tests for :shared, :android-shared, :androidApp and :androidTvApp: 7,287 passed. The new progress test fails when the paused-timeout check is removed.
  • Phone and TV debug builds: succeeded.
  • On an Android phone emulator (API 36) against a server running feat(playback): end native playback left paused past an admin timeout silo-server#5180 with the timeout at 1 minute:
    • paused playback left the player about 90 s later with the new notice and returned Home, keeping the position;
    • a 40 s pause followed by resume kept playing;
    • a main build showed "An administrator ended this playback session." for the same answer.
  • On an Android TV emulator (API 36) against the same server: paused playback left the player about 80 s later with the new notice and returned to the episode page; a 31 s pause followed by resume kept playing; a main build showed the administrator wording.
  • On an Android tablet emulator and an Android foldable emulator, folded and open (API 36), against the same server with the branch at 6f2d9c57a and main at bbbfdeeb5:
    • each paused playback left the player 76–84 s after the pause;
    • the branch showed "Playback stopped because it was paused for too long." on all three, and main showed "An administrator ended this playback session.";
    • the tablet returned to the series page and the foldable to Home, where each started.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-android/paused-playback-timeout/

Risks

  • The notice is a standard toast, so a viewer who is away when it fires may not see it.
  • The administrator notice is still hardcoded English, as before.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or how I checked a change nobody sees.

AI Disclosure

🤖 Generated with Claude Code

Note

Show exit notice when playback ends due to paused-timeout or admin server stop

  • Adds a PlaybackServerEnd enum with ADMIN and PAUSED_TIMEOUT reasons, each with its own exit notice string. A new ApiResult.playbackServerEnd mapper recognizes 410 responses with matching problem codes.
  • PlaybackSessionEnded lifecycle events now carry the session ID plus reason, and PlayerViewModel/TvPlayerViewModel leave playback with the reason's notice instead of always showing the admin notice.
  • Phone and TV video starts advertise the new paused-timeout client feature (PAUSED_TIMEOUT_V1_FEATURE via playbackClientFeaturesV3); Cast and audiobook starts omit it. The stored attempt repeats the feature on replan and seek-recovery paths.
  • Paused-timeout errors during subtitle transactions and seek recovery exit playback for the current session; other errors keep existing failure handling.
  • Risk: the session-ended event payload changes from a String to PlaybackSessionEnded, and the remote-stop flow in both view models now carries UiText instead of String — any collector of these flows must be updated (the in-tree screens in PlayerScreen.kt and TvPlayerScreen.kt are).

Macroscope summarized 6f2d9c5.

Quick104 and others added 3 commits November 23, 2026 03:44
…s a paused session

The server now ends a native video session that stays paused past an admin
limit and answers progress and replans with 410
playback_session_paused_timeout. Phone and TV leave the player the way an
administrator's end does, but show player.notice.pausedTimeout instead of
the admin wording.

- PlaybackSessionLifecycle names why the server ended a session
  (PlaybackServerEnd) and checks it before the sequenced branch, so the
  answer never becomes "progress pending" or a renewal.
- Remote stop requests carry UiText, so the notice follows the app language.
- Failure-recovery replans, seek reanchor and seek fallback, and staged
  subtitle, audio and quality replans leave on a paused-timeout answer.
  Admin ends keep their current handling on every path.
- A journal test pins that the exit's stop settles the attempt against the
  server's replayed receipt, so later starts send nothing for it.

Builds need the player.notice.pausedTimeout catalog key from
silo-translations #159; the client is re-pinned to its release separately.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Phone and TV video starts now send paused_timeout_v1, so the server answers
a session it ended for staying paused with 410
playback_session_paused_timeout instead of the admin wording. The attempt
remembers the choice and every replan (failure recovery, seek reanchor,
seek recovery) repeats it, matching the server's attempt-sticky feature.
Cast and audiobook starts keep the default and do not send it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Brings in the paused-too-long notice the player now shows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added the size/XL 500–999 added + deleted lines (all files); change volume, not priority. label Nov 23, 2026
@silo-kody

silo-kody Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T06:49:26.441587Z 6f2d9c5 New commits
🔒 Security Review ✅ Completed 2026-11-23T06:50:41.902760Z 6f2d9c5 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Walkthrough

The V3 playback protocol adds an opt-in paused-timeout feature. Mobile and TV playback retain the option across session requests, recognize paused-timeout server responses, and show the corresponding localized exit notice. Translation catalogs also add related messages and other strings.

Changes: Playback feature advertisement

Layer / File(s) Summary
Advertise paused-timeout support
shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt, android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt, android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerSeekReanchorTest.kt
The protocol adds PAUSED_TIMEOUT_V1_FEATURE. Mobile and TV video starts enable the feature, and the session manager includes it in subsequent replan and seek requests. Tests cover enabled and default starts and feature propagation.
Classify server ends and exit playback
android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycle.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerViewModel.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt, androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/PlayerScreen.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapter.kt, androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt, android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycleTest.kt, shared/src/commonTest/kotlin/org/siloserver/silo/repository/SequencedPlaybackTest.kt
The lifecycle reporter emits typed end reasons for administrator and paused-timeout responses. Mobile and TV ViewModels use those reasons for playback exit and notices. Subtitle transaction adapters invoke the timeout callback for matching stage or commit errors. Tests cover classification, lifecycle events, and sequenced stop handling.
Refresh translations and catalog metadata
.silo-translations, android-shared/silo-locales.properties, android-shared/src/androidMain/res/values*/strings_catalog.xml
The metadata and generated catalogs identify revision 2026.11.23-73e6a54. Locale catalogs add paused-timeout error and notice strings, a For You empty-state message, and a media-type label.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant PlaybackSessionManager
  participant Playback API
  participant PlaybackSessionLifecycle
  participant PlayerViewModel
  participant PlayerScreen
  PlaybackSessionManager->>Playback API: Send progress report
  Playback API-->>PlaybackSessionLifecycle: Return 410 paused-timeout error
  PlaybackSessionLifecycle->>PlayerViewModel: Emit session ID and typed end reason
  PlayerViewModel->>PlayerScreen: Emit localized exit notice
Loading

Suggested reviewers: rhainland, rxwatcher

Merge Risk: Low · up to 70221

Phone and TV players now stop with a localized notice when the server ends a session that was paused too long. A late paused-timeout response from a subtitle change on a previous session could occasionally close newly started playback. The impact is limited and recoverable, so the change is mergeable with that follow-up in mind.

Security architecture risk: Low · up to 70221

Pause timeouts use the existing playback exit. One track or quality change path does not verify that the timed-out session is still the one on screen before requesting that exit, so a delayed response could close replacement playback on the same device.

Retained concerns

  • Low · reliability · inferred: The phone and TV staged-replan adapters request a player exit on a timeout without passing the affected session identity. They do this before returning the error to the transaction's generation-scoped failure handler. If playback is replaced while the stage request is settling, a late timeout for the old session can request an exit for the replacement. The base did not turn this response into an exit on the staged path.
Security review details

Security Blast Radius

  • inferred — The identified stale-response exposure is bounded by the reviewed sink: an exit request to the phone or TV player handling the response. It can interrupt replacement playback on that device, but the callback does not target a remote account or another device.

Trust Boundaries and Controls

  • observed — The staged commit checks the base attempt, session, and plan before publishing a replacement. That commit guard does not govern the new exit side effect on a stage error, which occurs before commit.

Resilience and Maintainability Implications

  • observed — After a screen accepts the exit request, its exit flag suppresses repeated notices and prevents re-entry into the playback exit routine. This does not bind the first exit request to a session.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Android player now shows a notice when playback stops because it was paused too long. The changeset adds the 410 playback_session_paused_timeout handling, the paus…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description states the problem, approach, validation, and risks for the change. It names the paused-timeout handling, the 410 problem code, the advertised paused_timeout_v1 feature on phone and TV…
Full details: Title check

Explanation

The title names the main change: the Android player now shows a notice when playback stops because it was paused too long. The changeset adds the 410 playback_session_paused_timeout handling, the paused_timeout_v1 feature advertisement, and the localized notice text, so the title matches the primary change.

Full details: Description check

Explanation

The description states the problem, approach, validation, and risks for the change. It names the paused-timeout handling, the 410 problem code, the advertised paused_timeout_v1 feature on phone and TV video starts, and the localized notice. It also lists tests, emulator runs, and risks. It is directly related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added enhancement New feature or request evidence-required Needs before-and-after evidence before the Evidence check passes impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 23, 2026
@silo-triage

silo-triage Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Resolved: Android TV before-and-after captures and timeout-exit recordings now cover the original missing-artifact request, and the PR explains why tablet and foldable captures were not taken separately. Recording playback has not been independently verified.

Original request

The PR changes the timeout notice and exit behavior on Android TV, but the validation section says TV was built and unit-tested without being run. Please add before-and-after Android TV captures of the timeout notice and a short recording showing the player exit. CONTRIBUTING.md also asks for tablet and foldable (folded/open) captures, or an explanation of why those devices are unaffected.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e4a1b853-d293-4819-90b5-f171760002b3
Commits

Reviewing files that changed from the base of the PR and between bbbfdee and 702217c.

Files selected for processing: 55

  • .silo-translations
  • android-shared/silo-locales.properties
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycle.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/player/PlaybackSessionManager.kt
  • android-shared/src/androidMain/res/values-ar/strings_catalog.xml
  • android-shared/src/androidMain/res/values-b+zh+Hans/strings_catalog.xml
  • android-shared/src/androidMain/res/values-b+zh+Hant/strings_catalog.xml
  • android-shared/src/androidMain/res/values-bg/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ca/strings_catalog.xml
  • android-shared/src/androidMain/res/values-cs/strings_catalog.xml
  • android-shared/src/androidMain/res/values-da/strings_catalog.xml
  • android-shared/src/androidMain/res/values-de/strings_catalog.xml
  • android-shared/src/androidMain/res/values-el/strings_catalog.xml
  • android-shared/src/androidMain/res/values-es/strings_catalog.xml
  • android-shared/src/androidMain/res/values-et/strings_catalog.xml
  • android-shared/src/androidMain/res/values-fi/strings_catalog.xml
  • android-shared/src/androidMain/res/values-fr/strings_catalog.xml
  • android-shared/src/androidMain/res/values-hi/strings_catalog.xml
  • android-shared/src/androidMain/res/values-hr/strings_catalog.xml
  • android-shared/src/androidMain/res/values-hu/strings_catalog.xml
  • android-shared/src/androidMain/res/values-in/strings_catalog.xml
  • android-shared/src/androidMain/res/values-it/strings_catalog.xml
  • android-shared/src/androidMain/res/values-iw/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ja/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ko/strings_catalog.xml
  • android-shared/src/androidMain/res/values-lt/strings_catalog.xml
  • android-shared/src/androidMain/res/values-lv/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ms/strings_catalog.xml
  • android-shared/src/androidMain/res/values-nb/strings_catalog.xml
  • android-shared/src/androidMain/res/values-nl/strings_catalog.xml
  • android-shared/src/androidMain/res/values-pl/strings_catalog.xml
  • android-shared/src/androidMain/res/values-pt-rBR/strings_catalog.xml
  • android-shared/src/androidMain/res/values-pt-rPT/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ro/strings_catalog.xml
  • android-shared/src/androidMain/res/values-ru/strings_catalog.xml
  • android-shared/src/androidMain/res/values-sk/strings_catalog.xml
  • android-shared/src/androidMain/res/values-sl/strings_catalog.xml
  • android-shared/src/androidMain/res/values-sv/strings_catalog.xml
  • android-shared/src/androidMain/res/values-th/strings_catalog.xml
  • android-shared/src/androidMain/res/values-tr/strings_catalog.xml
  • android-shared/src/androidMain/res/values-uk/strings_catalog.xml
  • android-shared/src/androidMain/res/values-vi/strings_catalog.xml
  • android-shared/src/androidMain/res/values/strings_catalog.xml
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionLifecycleTest.kt
  • android-shared/src/androidUnitTest/kotlin/org/siloserver/silo/common/player/PlaybackSessionManagerSeekReanchorTest.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileSubtitleTransactionAdapter.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/player/MobileVideoPlaybackStarter.kt
  • 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
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerScreen.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvPlayerViewModel.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvSubtitleTransactionAdapter.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/player/TvVideoPlaybackStarter.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/playback/PlaybackProtocolV3.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/repository/SequencedPlaybackTest.kt

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

…wn session

A stage or commit answered 410 playback_session_paused_timeout called
the player's exit whatever session it was about, so a late answer for a
session the player had moved on from could stop the playback that
replaced it. The callback now carries the request's session, and the
phone and TV players leave only while it is still the active one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Copy link
Copy Markdown
Contributor Author

Added Android TV before-and-after captures (API 36 emulator, main at bbbfdee vs this branch at 702217c) of the timeout notice and the page it returns to, a recording of each run from pause to exit, and a pause-then-resume check; they're on the evidence page linked in the description. Tablet and foldable aren't captured separately: the change is the toast's text and the existing exit path in the shared phone player, with no layout change, so they show the same toast as the phone capture.

@macroscopeapp

macroscopeapp Bot commented Nov 23, 2026

Copy link
Copy Markdown

The paused-timeout exit and notice are visible on Android TV, but the PR says TV was not run; the evidence link therefore needs a short recording of the timeout and player exit on TV. The same change reaches the phone, tablet, and foldable (folded and open); the linked evidence should show those form factors too.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot removed the evidence-required Needs before-and-after evidence before the Evidence check passes label Nov 23, 2026
@Quick104

Copy link
Copy Markdown
Contributor Author

Android TV was run and is on the evidence page (before and after, with recordings of the timed exit). The page now also covers the tablet and the foldable, folded and open, before and after, each with a recording of the timed exit; the Validation section lists the results.

@Quick104
Quick104 merged commit 56e2356 into main Nov 23, 2026
10 checks passed
@Quick104
Quick104 deleted the feat/paused-playback-timeout branch November 23, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish size/XL 500–999 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant