feat(mobile): video zooming in asset viewer#22036
feat(mobile): video zooming in asset viewer#22036alextran1502 merged 12 commits intoimmich-app:mainfrom
Conversation
|
Anything gonna happen with this? :P |
Just waiting for review |
mobile/lib/presentation/widgets/asset_viewer/asset_viewer.page.dart
Outdated
Show resolved
Hide resolved
| final ValueNotifier<PhotoViewScaleState>? scaleStateNotifier; | ||
| final bool disableScaleGestures; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
|
I gave this a round of testing and noticed the following:
|
|
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. |
|
I know Apple Photos and YT let you play while 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 |
Same goes for Samsung Gallery / Samsung Video Player. Zooming and panning around in the zoomed area is possible during playback. |
…o being zoomable when bottom sheet is shown. Code cleanup.
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 |
d12fa74 to
ccbb619
Compare
|
After rebasing, the page change behaviour is still the same as main on my end, which does seem to be improved compared to release |
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).
Screenshots (if appropriate)
screen-20250915-164015.4.mp4
Checklist:
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.