Cesar Tejada
Cesar Tejada

Reputation: 81

iOS can we download HLS offline without using AVAssetDownloadURLSession?

lately I have been trying to implement HLS streaming and offline capabilities on my iOS project. Currently I have been using my own downloading library to download different streaming files, like Widevine streams. The issue that I notice is that AVAssetDownloadURLSession downloads the hls files and saves it on the phone locally in a .movpkg format. I have been looking online if there is any packager (Like Shaka-packager) where I could transform my hls file to .movpkg and then download the .movpkg using my own download library instead of relying on apple AVAssetDownloadURLSession. Any help is appreciated.

Thanks

Upvotes: 1

Views: 916

Answers (1)

dinis
dinis

Reputation: 434

One of the options is how to download and play HLS

  1. Download the remote m3u8 playlist
  2. Parse the playlist
  3. Download all the chunks for the required resolution and language (media0.ts, media1.ts, ...)
  4. Create a local m3u8 playlist (local_playlist.m3u8)
  5. Start the local server with the endpoint, which will return the local m3u8 and all chunks.
  6. Create an AVAsset with a URL to the local server.

Upvotes: 2

Related Questions