mirror of
https://github.com/immich-app/immich.git
synced 2026-03-02 15:10:08 -05:00
The changes in #25952 inadvertently removed an optimisation which prevents the video player from being recreated when the tree changed. This happens surprisingly often, namely when the hero animation finishes. The widget is particularly expensive, so recreating it 2-3 in a short period not only feels sluggish, but also causes the video to hitch and restart. The solution is to bring the global key back for the native video player. Unlike before, we are using a custom global key which compares the values of hero tags directly. This means we don't need to maintain a map of hero tags to global keys in the state, and also means we don't have to pass the global key down multiple layers. This also fixes #25981.