feat(player): richer stats for nerds on phone and TV - #34
Merged
Merged
Conversation
Bring the phone stats sheet and the TV HUD Stats pane to parity with prairie-smarttv Silo-Server#116: - Plan: play method, v3 delivery, container and codecs in one line, plus the planner's reason (decision trace, degradation warnings or the audio/DV claim reason) and server transformations. - The selected audio track (ordinal, language, codec, channels, title). - The stream actually mounted: kind (HLS/DASH/Progressive/Local file) and path only; query strings, userinfo and token-like segments are never shown. - Quality preference, declared video bitrate, audio channels, buffer ahead, rebuffers and startup time. - The last 8 player events (decoder init, format changes, state, dropped frames, underruns, load/player errors), wall-clock stamped, with URL queries stripped from error text. Identical consecutive events collapse with a repeat count so a burst cannot evict the error. The log survives finishPlayerStats so a retry still shows why the previous attempt failed. Formatting, redaction and the ring buffer live in :shared (playback/stats/StatsForNerds.kt) with commonTest coverage; the Media3 event mapping lives in android-shared with unit tests. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 31 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
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 |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Problem
The phone stats sheet and the TV HUD Stats pane list decoder and format facts, but nothing that explains a failure. There is no server plan or planner reason, no record of which audio track or stream is actually playing, and no player errors. prairie-smarttv added all of this in Silo-Server#116.
Solution
Both panels now show the same set, built from data the ViewModels already hold:
Remux · server_remux_progressive · container=mp4 · video=hevc 3840x1600 hdr10 · audio=eac3), then the planner reason (decision trace, then degradation warnings, then the audio/Dolby Vision claim reason) and server transformations.finishPlayerStats, so a retry still shows why the previous attempt failed.Where the code lives:
shared/.../playback/stats/StatsForNerds.kt(commonMain): the ring buffer, the redaction, the plan/track/quality/buffer formatting and the row builder, all pure.StatsForNerdsTestcovers them for the Kover gate.android-shared/.../PlayerStatsEvents.kt: maps Media3 events to log lines (PlayerStatsEventsTest).PlayerStatsSnapshotgains the declared bitrate, audio channels and the event log. The reducer stays pure; the ViewModels stamp events with the wall clock.PlaybackStatsSheetgets aplaybackContextfromPlayerOverlay.TvPlayerHudtakes the mountedstreamUrland builds the same context from its selected audio and quality rows.Live TV players still have no stats panel, the same as smarttv.
Validation
StatsForNerdsTest(:shared) andPlayerStatsEventsTest(android-shared). The existing reducer tests still apply; the reducer contract is unchanged.Follow-up
scripts/prairie-invariants.txtanchors forPlaybackStatsContext,recordPlayerEventand the HUDstreamUrlpass-through.AI disclosure: written by Claude Opus 5.5 (
claude-opus-5-5[1m]) in Claude Code (Claude Agent SDK); no other AI tooling.🤖 Generated with Claude Code