Best Practice for Downloading Videos, Storing File Locally, and Playing In App?

@notbrent I saw you on this repo/thread and was wondering if you (or others) had suggestions for downloading videos to be viewed offline, preferably inside the app.

Is it possible to use the Asset API for this?


Looks like you’ll need react-native-fetch-blob:

hmm seeing this now too


@arcomito I was looking to do the same thing as you!

Here’s a workaround for now:
(working with current Expo SDK 18, before any FileSystem API improvement/change)

How to use this workaround function:

It uses the undocumented FileSystem API behind the Asset API (inspired by @astonm’s code i found on github which put me on the way)

The issue was that with the downloadAsync function in Asset, you need the md5 hash of the file beforehand. But with a remote file, you don’t have it by default, unless you calculated it before!
So i created a downloadAsync alternative version without hash.

Expo demo app:
Demo app’s code:

I’m open to any improvement, suggestion etc!


Some websites can also help you to download videos online, such as keepvid, catchvideo, videograby, etc.
You can find many sites for downloading videos and their information there: It;s a good method to play the videos you like offline.