Skip to content

Create control to close the player and exit the current page like Instagram - #600

Open
AhmadFalahian wants to merge 558 commits into
feature-add-new-cupertino-skip-buttonsfrom
master
Open

AhmadFalahian wants to merge 558 commits into
feature-add-new-cupertino-skip-buttonsfrom
master

Conversation

@AhmadFalahian

Copy link
Copy Markdown

There is no control in your player to close the video player. For example, suppose we are in full screen mode and we want to stop the whole player and exit it by pressing the close button, like the mode that Instagram has for its own player.

@diegotori

diegotori commented Feb 17, 2022 •

Copy link
Copy Markdown
Collaborator

@AhmadFalahian Looks like this change needs to be scoped to just the changes to the player. Please fork from master, then re-submit this PR. Thank in advance.

diegotori and others added 29 commits April 1, 2024 18:46
Upgraded wakelock_plus to version 1.2.2.
…n material_controls.dart and material_desktop_controls.dart
Fix the logic of the Center Play Button icon selection
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 Sep 16, 2026

Copy link
Copy Markdown
Contributor

@diegotori This PR has no actual diff to review — it compares master against the old feature-add-new-cupertino-skip-buttons branch (frozen since Feb 2022), which is why it shows 500+ unrelated commits. I checked AhmadFalahian's fork across every branch and found no commits authored by them anywhere — this was effectively a feature request opened as a PR, with no code ever attached.

The underlying ask (a quick way to exit fullscreen) is now covered by #930, already merged into master.

Suggest closing this one.

diegotori and others added 26 commits September 16, 2026 15:20
feat: YouTube-style seek indicator for keyboard seeking
Add ChewieController.swapVideoSource (in-place video source replacement)
Adds a VideoQuality model and ChewieController support for it
(videoQualities, activeVideoQualityId, onVideoQualityChanged,
setVideoQualities, selectVideoQuality), with a Quality entry and
selection dialog in the Material, Material desktop and Cupertino
controls, plus an OptionsTranslation.qualityButtonText override.

Chewie owns the menu and the selection state; switching the stream is
left to the host via onVideoQualityChanged — typically a
swapVideoSource call for separate files per quality, or a rendition
switch on an adaptive stream. The menu stays hidden until more than
one quality is supplied.
Widget tests for the Cupertino and Material desktop quality flows
(gating, active check mark, host callback, translated button text, the
options-button gate for additionalOptions), plus unit tests for
VideoQuality equality and the OptionsTranslation.qualityButtonText
plumbing. The selection tests run while playing so the hide-timer
restart paths are exercised too.
Add typed video-quality selection to the options menu of all three skins
Mobile (MaterialControls):
- Double-tapping the left/right side of the video seeks backward/forward,
  flashing the accumulating seek indicator. The middle band is a dead zone.
- While the indicator is visible, further single taps in the same zone keep
  seeking (10s -> 20s -> 30s), like YouTube.
- Gated by ChewieController.allowDoubleTapSeek (default true) with the step
  set by ChewieController.doubleTapSeekDuration (default 10s). Disabled on
  live streams and when playback is finished.

Desktop (MaterialDesktopControls):
- Double-clicking the video toggles fullscreen, like the YouTube desktop
  player. Gated by ChewieController.allowDoubleTapToggleFullScreen (default
  true) and allowFullScreen.

The keyboard seek indicator state introduced by #953 moves from
_MaterialDesktopControlsState into a shared SeekIndicatorStateMixin so both
control sets drive the same SeekIndicator.

Double-tap-to-seek was first explored by punit1111 in #717.
pauseOnBackgroundTap, the display-tapped hide toggle, and the backward
tap-to-repeat zone check were the 8 lines codecov flagged as uncovered
in material_controls.dart's patch.
Mirror the subtitle-track support for audio: the controller now holds a
source-agnostic list of selectable AudioTracks, an active id and an
onAudioTrackChanged callback. Unlike subtitles, audio is never "off" — one
track is always active, and the menu entry only shows when more than one
track exists.

- ChewieController: audioTracks / activeAudioTrackId / onAudioTrackChanged /
  hasAudioTracks, setAudioTracks, selectAudioTrack; copyWith wired.
- Material + Material desktop controls: an Audio entry in the options menu
  opening a track picker.
- AudioTrackDialog widget + AudioTrack model.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add tests for the new audio-track feature so the patch is exercised and
codecov/patch stops reporting 0% on the changed lines:

- AudioTrack model: equality, hashCode, toString, optional language
- ChewieController: hasAudioTracks, setAudioTracks, selectAudioTrack,
  copyWith propagation, onAudioTrackChanged callback
- AudioTrackDialog widget: tile rendering, selection check icon, language
  hint, tap-to-pick and dismiss-with-null
- MaterialControls & MaterialDesktopControls: options menu surfaces the
  Audio entry only when >1 track and drives selection end to end

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Flutter 3.47 upgrade enabled prefer_initializing_formals. Keeps the
fields private, matching _PlaybackSpeedDialog in cupertino_controls.dart;
callers still pass tracks:/selectedId:.
feat: YouTube-style tap gestures (double-tap seek zones on mobile, double-click fullscreen on desktop)
Generalise subtitle support beyond a single on/off cue list: the controller
now holds a source-agnostic list of selectable SubtitleTracks, an active id
and an onSubtitleTrackChanged callback, plus a liveSubtitle ValueNotifier for
streaming sources (e.g. HLS) that emit cue text over time.

- ChewieController: subtitleTracks / activeSubtitleTrackId /
  onSubtitleTrackChanged / liveSubtitle, setSubtitleTracks, selectSubtitleTrack,
  setLiveSubtitle; copyWith + dispose wired.
- Material + Material desktop controls: a Subtitles entry in the options menu
  opening a track picker, live-cue rendering reusing subtitleBuilder, and a
  track-aware toggle.
- SubtitleTrackDialog widget + SubtitleTrack model.
Adds unit and widget tests for the new subtitle-track API:
- SubtitleTrack model (equality, hashCode, toString)
- SubtitleTrackDialog (rendering, selection, custom off label, dismissal)
- ChewieController track methods (setSubtitleTracks, selectSubtitleTrack,
  setLiveSubtitle, copyWith, dispose, hasSubtitleTracks)
- Material and desktop controls: toggle-driven selection, options-menu
  track picker, live-cue and static-cue rendering, custom subtitleBuilder

Brings patch coverage to ~99%.
The Material controls passed the optionsTranslation subtitle label into the
SubtitleTrackDialog's "off" entry, but the desktop controls always showed the
hardcoded "Off". Mirror the Material behavior so both variants honor
optionsTranslation.subtitlesButtonText.
The Flutter 3.47 upgrade enabled prefer_initializing_formals. Keeps the
fields private, matching _PlaybackSpeedDialog in cupertino_controls.dart;
callers still pass tracks:/selectedId:.
selectSubtitleTrack and setSubtitleTracks notify ChewieController, but the
Material and desktop controls only listened to the video controller, so
_subtitleOn never moved when the host drove selection from code instead of a
UI tap. Since _buildSubtitleLayer bails out on !_subtitleOn, a programmatic
selection rendered no cues at all until the user tapped the toggle — the
common path for HLS, where tracks are discovered from the manifest.

Listen to ChewieController in both controls and mirror activeSubtitleTrackId
into _subtitleOn. Guarded on hasSubtitleTracks so the legacy single-subtitle
toggle keeps its current behaviour, and on an actual value change so the
other notifyListeners callers don't trigger spurious rebuilds.
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.