I need a way to add videos to a firebase database, and I was able to find a video where someone had explained how to do this with native coding, but I was wondering if there was a way to do this with flutter.
1 Answers
This will not be possible (if you are sane).
The maximum data size of a string in the Realtime Database is 10 MB and it would be one hell of a torture to try to store videos in chunks of UTF-8 encoded strings.
Firebase offers Cloud Storage for Firebase, where you can easily store videos and other files.
The documentation is great for beginners with Cloud Storage and it should be easy to integrate it into your existing Realtime Database project.
If you compare GB stored
of the Realtime Database and Cloud Storage on the pricing page, you will quickly realise that it would be insane to store videos in the Database instead of Cloud Storage.
The documentation on the Firebase website do not yet include Flutter, but the firebase_storage
Flutter plugin is easy to operate in combination with the official docs.

- 114,516
- 58
- 291
- 402
-
Would the user be able to access the videos even if they are offline? If not, would there be a way to download the videos from the cloud storage to their device? – Coder Aug 12 '18 at 03:02
-
Storing files in local storage using Flutter is not complicated. [Here are some nice references](https://stackoverflow.com/a/41448527/6509751). You also get `File` type objects from Cloud Storage, which makes that really easy to use. – creativecreatorormaybenot Aug 12 '18 at 03:48