Skip to content

Player: Stream Quality panel (redesign of the Statistics popup)#1323

Open
AKnassa wants to merge 1 commit into
Stremio:developmentfrom
AKnassa:feat/stream-health-panel
Open

Player: Stream Quality panel (redesign of the Statistics popup)#1323
AKnassa wants to merge 1 commit into
Stremio:developmentfrom
AKnassa:feat/stream-health-panel

Conversation

@AKnassa

@AKnassa AKnassa commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

What this does

Replaces the in-player Statistics popup with a Stream Quality panel that answers "will this play smoothly" in plain language.

What changed

  • A colour-coded quality meter (Poor / Fair / Good) with a one-line verdict, e.g. "Smooth playback. No pauses expected."
  • Each signal explains itself: Sources ("where your video streams from"), Buffer ("safe to watch before it loads more", in minutes/seconds), Speed ("faster/slower than you're watching").
  • Buffer is read from the real player buffer, so it reflects whether playback will actually stall, not just total download progress.
  • Raw details (Completed %, Info hash) move into a collapsible More details with a smooth expand animation; tap the info hash to copy it.
  • No new dependencies, no extra backend calls (reuses data already fetched). The scoring/formatting logic is pure and covered by 93 unit tests.

How to see it

statistics

Play a torrent stream, then open the panel from the network icon in the control bar. Try a fresh stream, a healthy stream, and a fully-cached title.

Notes for reviewers

New user-facing strings are added inline as t('KEY', { defaultValue: '...' }). Here are the new keys that need adding to stremio-translations — I'm happy to open the matching PR there:

PLAYER_STREAM_QUALITY
PLAYER_QUALITY_CHECKING  PLAYER_QUALITY_GOOD  PLAYER_QUALITY_FAIR  PLAYER_QUALITY_POOR  PLAYER_QUALITY_LIMITED
PLAYER_QUALITY_VERDICT_CHECKING  PLAYER_QUALITY_VERDICT_CACHED  PLAYER_QUALITY_VERDICT_GOOD
PLAYER_QUALITY_VERDICT_FAIR  PLAYER_QUALITY_VERDICT_POOR  PLAYER_QUALITY_VERDICT_LIMITED
PLAYER_SIGNAL_SOURCES  PLAYER_SIGNAL_SOURCES_MEANING
PLAYER_SIGNAL_BUFFER  PLAYER_SIGNAL_BUFFER_MEANING  PLAYER_SIGNAL_BUFFER_MEANING_CACHED
PLAYER_SIGNAL_BUFFER_VALUE_CACHED  PLAYER_SIGNAL_BUFFER_VALUE_UNKNOWN
PLAYER_SIGNAL_SPEED  PLAYER_SIGNAL_SPEED_MEANING_OK  PLAYER_SIGNAL_SPEED_MEANING_SLOW  PLAYER_SIGNAL_SPEED_VALUE_CACHED
PLAYER_MORE_DETAILS  PLAYER_COMPLETED  PLAYER_INFO_HASH  PLAYER_COPY_INFO_HASH  PLAYER_INFO_HASH_COPIED
MB_S  COPIED

One deliberate design choice worth calling out: the meter fills to 99% for a perfectly streaming title and only reaches 100% for a fully-downloaded (cached) one, to keep those two states visually distinct.

@AKnassa
AKnassa marked this pull request as ready for review July 1, 2026 06:11
@kKaskak
kKaskak requested a review from Botsy July 7, 2026 14:10

@Botsy Botsy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I reviewed and tested the changes. Overall, a clean, well-tested PR. Good call reframing raw numbers into a plain-language verdict. Pure logic extracted into streamQuality.js with solid edge-case test coverage; units consistent; conventions followed. 👍

A few non-blocking notes:

  1. Cast path reads "Poor" for healthy streams. On the Chromecast sender path buffered is null (vs ms on the HTML path), so bufferAhead returns 0 and cast torrents score near-zero on buffer regardless of health. Regression from the old panel. Handle null-buffer or note cast as out of scope.

  2. keepingUp === null scored as "not keeping up." Until duration is known (and for live streams), keepingUp is null, and keepingUp ? 20 : 0 docks 20 points at the moment the panel opens — healthy streams can transiently read Fair/Poor. Noted as a follow-up; flagging since it hits the primary case.

  3. Minor: onCopyInfoHash deps are [infoHash] only — missing t/toast (stale translation on mid-stream language switch; likely trips exhaustive-deps).

  4. Translations: the inline defaultValue strings are fine as a stopgap, but we'd expect the new PLAYER_QUALITY_* / PLAYER_SIGNAL_* keys to land in a matching PR on the stremio-translations repo before merge.

Thank you for contributing!

AKnassa added a commit to AKnassa/stremio-web that referenced this pull request Jul 8, 2026
Grade Good/Fair/Poor only when buffer runway or download-vs-bitrate is
measurable; when neither is (Chromecast emits buffered null, live/unknown
duration makes keepingUp null), show a neutral "Limited" state instead of
scoring on peer count alone. Peers is swarm connectivity, not proof of
smooth playback, so peers-only no longer yields a false Good or false Poor.

- bufferAhead returns null (not 0) for non-finite input, so "unavailable"
  is distinct from a real zero-second buffer.
- Reword verdicts to describe playback outcome, not the buffer, so the
  headline never contradicts a "Buffer: Not available" row on cast/live.
- Fix onCopyInfoHash deps to [infoHash, t, toast] (was [infoHash]) to
  avoid a stale-language copy toast after a mid-stream language switch.

Addresses review feedback on Stremio#1323.
@AKnassa
AKnassa requested a review from Botsy July 8, 2026 23:32
Botsy
Botsy previously approved these changes Jul 13, 2026
@kKaskak
kKaskak self-requested a review July 21, 2026 19:59

@kKaskak kKaskak left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  • Remove tests/streamQuality.spec.js; new tests are prohibited by repo guidance.
  • Replace the arbitrary quality score with objective playback signals, or document product-approved thresholds.
  • Account for playback speed when calculating buffer runway and required download speed.
  • Show Limited when real player buffer data is unavailable; avoid promises like “will not buffer.”
  • Add all strings to stremio-translations, bump the dependency when pr merged, and remove inline English fallbacks.
  • Make the new helper TypeScript and remove unrelated/refactored code.
    Remove or split the info-hash copy feature into a separate PR.
  • Squash into concise commits without commit bodies and shorten the PR description.
  • Verify web, desktop shell, Chromecast, cached/fresh torrents, multiple playback speeds, and non-English UI.

@kKaskak

kKaskak commented Jul 21, 2026

Copy link
Copy Markdown
Member

also for reference we have added a simple contribution guide
https://github.com/Stremio/stremio-web/blob/development/CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants