Create control to close the player and exit the current page like Instagram - #600
Open
AhmadFalahian wants to merge 558 commits into
Open
AhmadFalahian wants to merge 558 commits into
AhmadFalahian wants to merge 558 commits into
Conversation
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. |
Upgraded wakelock_plus to version 1.2.2.
…n material_controls.dart and material_desktop_controls.dart
package upgrades
Fix the logic of the Center Play Button icon selection
Add bufferingBuilder
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.
Contributor
|
@diegotori This PR has no actual diff to review — it compares The underlying ask (a quick way to exit fullscreen) is now covered by #930, already merged into Suggest closing this one. |
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)
feat: multi-track audio selection
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.
feat: multi-track subtitle selection
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.
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.