Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preliminary Scrubbing #1884

Merged
merged 10 commits into from
Mar 17, 2025
Merged

Preliminary Scrubbing #1884

merged 10 commits into from
Mar 17, 2025

Conversation

EricBAndrews
Copy link
Member

Issues

Description

This PR lays out the core architecture for gif/video scrubbing. MediaControlState now tracks two new fields:

  • playbackPosition: set by the animated media; indicates current playback position
  • scrubTarget: set by the control layer; informs the animated media where to scrub to

The underlying animated media types have been updated to populate and listen to those fields, respectively.

There are a few outstanding issues that will be addressed in later PRs:

  • UI: this PR comes with a rudimentary playback bar. The circle can be dragged to scrub. It's not very pretty and a bit of a pain to use, but the point of it is just to provide a minimal working interface to scrub videos. Improved GIF/Video Scrubbing #1834 is open to track this.
  • Performance when scrubbing backwards: all media types, but webp and gif in particular, suffer when scrubbing backwards. There are some tricks that might help performance here, but most of them will require rewriting AnimatedImageView using UIViewRepresentable around the underlying SDWebImage UIKit components. Better webp, gif rendering #1883 is open to track this.

Implementation Notes

  • Removes Gifu. SDWebImage now handles all animated images. The .gif and .webp cases of the MediaType enum have been merged into .animated.

@EricBAndrews EricBAndrews requested a review from a team as a code owner March 17, 2025 02:07
@EricBAndrews EricBAndrews requested review from Sjmarf and removed request for a team March 17, 2025 02:07
Copy link
Member

@Sjmarf Sjmarf left a comment

Choose a reason for hiding this comment

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

Awesome work! A couple of localization notes

EricBAndrews and others added 4 commits March 17, 2025 15:56
Co-authored-by: Sjmarf <78750526+Sjmarf@users.noreply.github.com>
Co-authored-by: Sjmarf <78750526+Sjmarf@users.noreply.github.com>
@EricBAndrews EricBAndrews merged commit 1f001b0 into dev Mar 17, 2025
2 checks passed
@EricBAndrews EricBAndrews deleted the eric/scrubbing branch March 17, 2025 20:11
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.

GIF/Video Scrubbing
2 participants