Skip to content

feat: YouTube-style seek indicator for keyboard seeking - #953

Open
Ortes wants to merge 5 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-seek-indicator
Open

feat: YouTube-style seek indicator for keyboard seeking#953
Ortes wants to merge 5 commits into
fluttercommunity:masterfrom
Ortes:feat/keyboard-seek-indicator

Conversation

@Ortes

@Ortes Ortes commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

What

Adds a YouTube-style seek indicator that flashes on screen when the user seeks with the keyboard arrows on the desktop controls (MaterialDesktopControls).

  • Pressing → / ← shows a small pill with a directional icon and the amount seeked.
  • Repeated presses in the same direction keep the pill visible and accumulate the total (e.g. 10s20s30s), just like YouTube.
  • Pressing the opposite direction (or after the pill fades ~0.9s) resets the counter.

How

  • New reusable widget lib/src/seek_indicator.dart (fades via AnimatedOpacity, mirrors the existing CenterSeekButton style; purely visual — wrapped in IgnorePointer).
  • _MaterialDesktopControlsState accumulates the seeked seconds in _seekForward/_seekBackward (kept in sync with the existing Duration seek step) and auto-hides via a Timer, mirroring the existing buffering-indicator pattern.
  • Gated by a new ChewieController.showSeekIndicator option (default true), wired through copyWith.

Tests

test/seek_indicator_test.dart covers accumulation on repeated presses, direction reset, auto fade-out, the showSeekIndicator: false opt-out, and the option default/copyWith.

dart format, flutter analyze lib test, and the full flutter test suite are clean.

Ortes added 4 commits July 8, 2026 20:05
Flash a pill showing the seeked amount when seeking with the arrow keys
on the desktop controls. Repeated presses in the same direction keep it
visible and accumulate the total (10s, 20s, 30s, ...); the opposite
direction resets it. Gated by the new ChewieController.showSeekIndicator
option (default true).
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.61905% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 50.97%. Comparing base (69a8fc7) to head (637e2a7).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
lib/src/chewie_player.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #953      +/-   ##
==========================================
+ Coverage   43.82%   50.97%   +7.15%     
==========================================
  Files          21       22       +1     
  Lines        1602     1642      +40     
==========================================
+ Hits          702      837     +135     
+ Misses        900      805      -95     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Replace the hardcoded 10s seek step with a new
ChewieController.keyboardSeekDuration option (default 10 seconds) that
drives both the arrow-key seek and the amount shown by the indicator.
@Ortes

Ortes commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Hi @diegotori 👋

Beyond this PR, I'd like to offer to help with maintenance on chewie if you're open to it.

A bit of context:

I know the open-PR queue is long, and I'd be glad to take some of that load off you: triaging and reviewing PRs, keeping the package current with new Flutter releases, and helping land fixes. Would you be open to adding me as a co-maintainer (or triage access to start)? Happy to do whatever works best for you and the Flutter Community org.

Either way, thanks for maintaining this 🙏

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.

1 participant