The optimal way for loading large video from iOS gallery + reopen it on next app launch
18:27 28 Feb 2026

What I need:

  • play a user-picked video from iPhone gallery with my custom playback controls

  • read the video metadata (ex. duration)

  • be able to reopen the video on next app launch

  • do it in the fastest way, even for multi-gigabyte videos

  • don't deal with access permissions since iOS offers the built in secure photos picker

After trying various approaches, it doesn't look easy to accomplish all my needs. I found two options:

  • use PhotosPicker(selection: $selectedVideoItem, matching: .videos) component from swift UI. It provides PhotosPickerItem in result which I handle getting AVAsset from it and passing it to my videoplayer component. Two issues with this approach:

    • I need to utilize selectedVideoItem.itemIdentifier to be able to reopen the video on next app launch, but it isn't accessible until user grants full access to photos gallery

    • PhotosPicker UI doesn't look consistent - if an error occurs, the selectedVideoItem remains, so opening the picker second time shows it preselected, but it can't be loaded because of the error

  • load the video as a file through loadFileRepresentation(). This seems to work and I will able to reopen the video on further app launches since it's stored in a temp file. But I don't like that the video is actually copied to a file, so I need to take care of it and handle surrounding edge cases (ex. failure on copy, limited storage space).

So, interesting if there's way to get this stuff working without copying the video to a temp file. Or maybe there's another option...

ios performance swiftui video photo-gallery