Skip to content

feat(mobile): video zooming in asset viewer#22036

Merged
alextran1502 merged 12 commits intoimmich-app:mainfrom
goalie2002:feat/video-zooming
Feb 22, 2026
Merged

feat(mobile): video zooming in asset viewer#22036
alextran1502 merged 12 commits intoimmich-app:mainfrom
goalie2002:feat/video-zooming

Conversation

@goalie2002
Copy link
Contributor

@goalie2002 goalie2002 commented Sep 16, 2025

Description

Adds the ability to zoom into videos in the asset viewer (including the video portion of live photos).

Addresses #12034

Possible future improvement: Zooming on the video portion of live photos does work, but does not maintain the zoom level that the photo was at, and vice versa, so the zoom resets every time it switches between the two.

How Has This Been Tested?

Tested on a OnePlus 6t (Android 15) and on iOS simulator (iOS 26).

  • Viewed a video in asset viewer and zoomed into video. Also checked that all asset viewer functions still work (like bottom sheet).
  • Viewed the video portion of a live photo and checked that zooming works there.
  • Viewed a video in memories. Confirmed that zooming does not work here and video still plays correctly.

Screenshots (if appropriate)

screen-20250915-164015.4.mp4

Checklist:

  • I have performed a self-review of my own code
  • I have no unrelated changes in the PR.
  • I have confirmed that any new dependencies are strictly necessary.
  • I have followed naming conventions/patterns in the surrounding code

Please describe to which degree, if any, an LLM was used in creating this pull request.

While I did attempt to use an LLM for some things, it ended up being incredibly useless, so all of the code was hand written and an LLM was only occasionally used as quicker google.

@RobinHirst11
Copy link

Anything gonna happen with this? :P

@goalie2002
Copy link
Contributor Author

Anything gonna happen with this? :P

Just waiting for review

Comment on lines +57 to +58
final ValueNotifier<PhotoViewScaleState>? scaleStateNotifier;
final bool disableScaleGestures;
Copy link
Member

Choose a reason for hiding this comment

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

Do we have to pass these down to the video viewer and handle it here rather than handling it inside the asset_viewer itself? PhotoViewGalleryPageOptions.customChild takes the same parameters as PhotoView.customChild and the scaleStateChangedCallback is on the PhotoViewGallery.builder

Copy link
Contributor Author

@goalie2002 goalie2002 Feb 13, 2026

Choose a reason for hiding this comment

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

I believe it's necessary for the same reason we need the separate PhotoView in the video viewer: the asset viewer's videoBuilder includes the controls, so if we were to apply zoom there it would zoom the controls too (along with some other issues that I don't remember the details of; I did try this early on in the pr). So we need the separate photoView in the video viewer to exclusively zoom the video, meaning we also need to pass the disableGestures and scaleState to the photoView responsible for the actual zooming. The asset viewer one basically just acts as a wrapper (hence the permanently disabled scale gestures)

@shenlong-tanwen
Copy link
Member

I gave this a round of testing and noticed the following:

  • The page switch animation between different assets is different. Especially when you swipe across multiple videos, the animation from this PR is different than the one on main. Rather than sliding, this feels like the new video moves over the old one
  • We can pan around images after zoomed in, but that doesn't seem to be the case with videos. So once you're zoomed in, the video keeps playing and you cannot move without zooming out and zooming back in.
  • Also, do we want videos to continue playing while zoomed in? I haven't used the other app much, but can you compare how other apps handle this? Do they not pause the video when zoomed?

@arnolicious
Copy link
Collaborator

I don't really know how other apps handle it, but fwiw if it is technically possible, I think it would be great to be able to keep playing videos when zooming in.

@mertalev
Copy link
Member

I know Apple Photos and YT let you play while zoomed.

@goalie2002
Copy link
Contributor Author

goalie2002 commented Feb 15, 2026

I gave this a round of testing and noticed the following:

  • The page switch animation between different assets is different. Especially when you swipe across multiple videos, the animation from this PR is different than the one on main. Rather than sliding, this feels like the new video moves over the old one

  • We can pan around images after zoomed in, but that doesn't seem to be the case with videos. So once you're zoomed in, the video keeps playing and you cannot move without zooming out and zooming back in.

  • Also, do we want videos to continue playing while zoomed in? I haven't used the other app much, but can you compare how other apps handle this? Do they not pause the video when zoomed?

I haven't noticed the differing page changing animations since the hardware I test on is pretty slow on the debug build. I'll look into that

I was able to pan around just fine (you can see it in the demo video on the PR). Sometimes it's hard to tell with the video movement, but if it truly doesn't work for you, do you have reproduction steps?

Both Google Photos and Apple photos keep the video playing while zooming

Thanks for taking a look :), it'll be about a week before I can continue working on this

@1661410107114145152525
Copy link

1661410107114145152525 commented Feb 20, 2026

I know Apple Photos and YT let you play while zoomed.

Same goes for Samsung Gallery / Samsung Video Player. Zooming and panning around in the zoomed area is possible during playback.

@goalie2002
Copy link
Contributor Author

goalie2002 commented Feb 20, 2026

  • The page switch animation between different assets is different. Especially when you swipe across multiple videos, the animation from this PR is different than the one on main. Rather than sliding, this feels like the new video moves over the old one

I tested on this branch and release, and it seems to be the same to me, at least on android. There is the "move over" effect only when the thumbnail of the video is displayed instead of the video itself (i.e. while loading), and that happens on both release and this branch. When the video is loaded/playing, the transition animation is as expected (both here and release). So as far as I can tell the bug wasn't introduced in this PR. LMK if you were seeing something different

@goalie2002
Copy link
Contributor Author

After rebasing, the page change behaviour is still the same as main on my end, which does seem to be improved compared to release

@alextran1502 alextran1502 merged commit f0e2fce into immich-app:main Feb 22, 2026
44 checks passed
@goalie2002 goalie2002 deleted the feat/video-zooming branch February 22, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Videos have corrupted bar bottom and right side of viewport (during playback and while paused) on Android app

7 participants