Skip to content

feat(share_plus): preview a video frame in the share sheet on iOS - #3959

Open
gabdsg wants to merge 2 commits into
fluttercommunity:mainfrom
gabdsg:ios-video-thumbnail
Open

feat(share_plus): preview a video frame in the share sheet on iOS#3959
gabdsg wants to merge 2 commits into
fluttercommunity:mainfrom
gabdsg:ios-video-thumbnail

Conversation

@gabdsg

@gabdsg gabdsg commented Aug 17, 2026

Copy link
Copy Markdown

Sharing a video shows a generic document icon where an image shows a preview. The preview is built with imageWithContentsOfFile:, which returns nil for a video, and both call sites are gated on a mime type starting with image/ -- including the imageProvider on the link metadata, which is what draws the sheet's header.

Extracts one previewImage helper both call sites use, and adds a videoThumbnailForPath: that pulls a frame with AVAssetImageGenerator. appliesPreferredTrackTransform is set so portrait footage is not previewed sideways, the frame is taken half a second in because frame zero is black on anything that fades in, and the +1 reference from copyCGImageAtTime is released.

No Dart API change.

Description

Related Issues

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

Sharing a video shows a generic document icon where an image shows a
preview. The preview is built with `imageWithContentsOfFile:`, which
returns nil for a video, and both call sites are gated on a mime type
starting with `image/` -- including the `imageProvider` on the link
metadata, which is what draws the sheet's header.

Extracts one `previewImage` helper both call sites use, and adds a
`videoThumbnailForPath:` that pulls a frame with AVAssetImageGenerator.
`appliesPreferredTrackTransform` is set so portrait footage is not
previewed sideways, the frame is taken half a second in because frame
zero is black on anything that fades in, and the +1 reference from
`copyCGImageAtTime` is released.

No Dart API change.
@gabdsg gabdsg changed the title [share_plus] iOS: preview a video frame in the share sheet feat(share_plus): preview a video frame in the share sheet on iOS Aug 17, 2026
@gabdsg

gabdsg commented Aug 17, 2026

Copy link
Copy Markdown
Author

I see some tests are failing, but they don't appear to be related to the changes I made.

@vbuberen

Copy link
Copy Markdown
Collaborator

Yeah, just ignore them. Will review at some point, but currently have a limited availability, so no hard promises.

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.

2 participants