BLACK FRIDAY SALE: Save big on all my Swift books and bundles! >>

Save Remote Video URL directly to Iphone (SwiftUI)

Forums > SwiftUI

Hello

I have been working on an app where I have to download remote videos from a website when the direct URL of course is known.

Example : www.sjak.dk/xx.mp4 <-- Not a working link - just to use as an example :)

How is this done so I can combine it with UISaveVideoAtPathToSavedPhotosAlbum

any tutorials or similar to work with? I have searched a lot of videos, but none is useful.

I know how to do it with images and UIImageWriteToSavedPhotosAlbum, but not with the video part.

Regards in advance

Morten, Denmark

   

It depends…on whether or not it's a single video file or a streaming bundle (e.g., HLS).

Streaming bundles are a directory containing:

  • video in various resolutions segmented into little tiny pieces
  • audio for same, usually in multiple formats, and possibly multiple languages
  • captions
  • audio description (voice captions describing the sound)
  • snapshots that you see as you scrub through the video in the same resolution as the video
  • m3u8 files that give the priority order for all of the above.

My guess is that HLS would be far harder (I work on the other end of this, so have frankly never tried), but plain video in a single file is just like any other file on the server.

   

It is not HLS. Just simple files (mostly mp4) so the user can download this file and save it directly on camera roll with just a simple click.

What way would be the easiest way to do it.

Can´t seem to find anything (other than apple documentation) on this topic anywhere and it is beginning to drive me a little crazy. :)

Is it because ppl don´t use this function alot?

   

Hacking with Swift is sponsored by RevenueCat

SPONSORED In-app subscriptions are a pain to implement, hard to test, and full of edge cases. RevenueCat makes it straightforward and reliable so you can get back to building your app. Oh, and it's free if your app makes less than $10k/mo.

Learn more

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.