Search code examples
swift3saverealmios10offline-caching

Downloading and saving streamed video in iOS app (Swift 3.0) using Realm


I want to download a video from a url, save it in the app, and be able to play it offline, meaning no internet connection. Is using Realm the best way to do this?


Solution

  • Absolutely not. Realm is designed for quickly storing and retrieving collections of basic data types, and this architecture does not work well for large opaque binary blobs. Since Realm uses a memory-mapping mechanism, to access the data on disk, it has specific device-dictated size limits as to how large the data can be that it is able to store.

    I recommend you watch the WWDC 2016 video 'What's New in HTTP Live Streaming', where system level features for offline caching streaming video were introduced. :)