Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stream videos using Firebase in Android

I already found a similar question here but that was asked almost 2 years ago. Currently, I am working on a video streaming app for Android and I was thinking if using Firebase to host the videos is a viable option.

I tried using the URL of the video stored in Firebase storage to play the video in my app and it is working just fine.

But I searched online and found that everybody is advising not to use Firebase for the same. Is there any particular reason why Firebase shouldn't be used for this purpose?

P.S. In my case, all the videos that need to be streamed will be in HD and will have a longer time duration.

Any help will be appreciated. Thanks in advance.

like image 997
Mehul Kanzariya Avatar asked Apr 20 '19 07:04

Mehul Kanzariya


People also ask

Does Firebase support video streaming?

The Firebase SDKs for Cloud Storage add Google security to file uploads and downloads for your Firebase apps, regardless of network quality. You can use our SDKs to store images, audio, video, or other user-generated content. On the server, you can use Google Cloud Storage APIs to access the same files.

Can you upload videos to Firebase?

Cloud Storage for Firebase allows you to quickly and easily upload files to a Cloud Storage bucket provided and managed by Firebase. Note: By default, a Cloud Storage bucket requires Firebase Authentication to perform any action on the bucket's data or files.


2 Answers

Firebase Storage does not place restrictions on the type of files you can upload to it. So you can upload video files with no problem. However, if you are expecting to be able to stream the video out in different formats for different types of clients, you might be disappointed. You should think of Firebase Storage mostly as a general file storage solution, not a video streaming solution.

And Also with consideration of the firebase usage costings, you probably will have to pay a lot of money as your userbase grows.

read here and here

like image 65
Lakshan Dissanayake Avatar answered Sep 27 '22 13:09

Lakshan Dissanayake


In order to stream videos it's better to use some streaming protocol like DASH of HLS, as it will load the next video chunk adaptively according to network speed etc.

If you have any thoughts of supporting iOS as well, you'd want to choose HLS which is supported on Android and iOS.

There's a way to host HLS videos for streaming on Firebase Cloud Storage, as I wrote in this answer: Firebase Storage Video Streaming

like image 34
syonip Avatar answered Sep 24 '22 13:09

syonip